Skip to content

Commit

Permalink
Fix MinGW build.
Browse files Browse the repository at this point in the history
  • Loading branch information
jschueller committed Jul 4, 2014
1 parent 3d07691 commit 4fcc76f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ SET(CMAKE_MODULE_PATH
)

SET(VERSION 2.2.0)
option(BUILD_SHARED_LIBS "build shared/static libs" ON)

INCLUDE(DefineInstallationPaths)

Expand Down
8 changes: 4 additions & 4 deletions cmake/Modules/DefineInstallationPaths.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if (UNIX)
if (UNIX OR MINGW)
IF (NOT APPLICATION_NAME)
MESSAGE(STATUS "${PROJECT_NAME} is used as APPLICATION_NAME")
SET(APPLICATION_NAME ${PROJECT_NAME})
Expand Down Expand Up @@ -122,9 +122,9 @@ if (UNIX)
CACHE PATH "The ${APPLICATION_NAME} info install dir (default prefix/info)"
FORCE
)
endif (UNIX)
endif ()

if (WIN32)
if (MSCV)
# Same same
SET(BIN_INSTALL_DIR .)
SET(SBIN_INSTALL_DIR .)
Expand All @@ -134,5 +134,5 @@ if (WIN32)
SET(ICON_INSTALL_DIR .)
SET(SOUND_INSTALL_DIR .)
SET(LOCALE_INSTALL_DIR lang)
endif (WIN32)
endif (MSCV)

24 changes: 16 additions & 8 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ SET(floatfann_LIB_SRCS
floatfann.c
)

ADD_LIBRARY(floatfann SHARED ${floatfann_LIB_SRCS})
ADD_LIBRARY(floatfann ${floatfann_LIB_SRCS})

SET_TARGET_PROPERTIES(floatfann PROPERTIES VERSION ${VERSION} SOVERSION 2 )
INSTALL(TARGETS floatfann DESTINATION ${LIB_INSTALL_DIR} )
INSTALL(TARGETS floatfann LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
RUNTIME DESTINATION ${BIN_INSTALL_DIR} )


########### next target ###############
Expand All @@ -23,10 +25,12 @@ SET(doublefann_LIB_SRCS
doublefann.c
)

ADD_LIBRARY(doublefann SHARED ${doublefann_LIB_SRCS})
ADD_LIBRARY(doublefann ${doublefann_LIB_SRCS})

SET_TARGET_PROPERTIES(doublefann PROPERTIES VERSION ${VERSION} SOVERSION 2 )
INSTALL(TARGETS doublefann DESTINATION ${LIB_INSTALL_DIR} )
INSTALL(TARGETS doublefann LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
RUNTIME DESTINATION ${BIN_INSTALL_DIR} )


########### next target ###############
Expand All @@ -35,10 +39,12 @@ SET(fixedfann_LIB_SRCS
fixedfann.c
)

ADD_LIBRARY(fixedfann SHARED ${fixedfann_LIB_SRCS})
ADD_LIBRARY(fixedfann ${fixedfann_LIB_SRCS})

SET_TARGET_PROPERTIES(fixedfann PROPERTIES VERSION ${VERSION} SOVERSION 2 )
INSTALL(TARGETS fixedfann DESTINATION ${LIB_INSTALL_DIR} )
INSTALL(TARGETS fixedfann LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
RUNTIME DESTINATION ${BIN_INSTALL_DIR} )


########### next target ###############
Expand All @@ -47,8 +53,10 @@ SET(fann_LIB_SRCS
floatfann.c
)

ADD_LIBRARY(fann SHARED ${fann_LIB_SRCS})
ADD_LIBRARY(fann ${fann_LIB_SRCS})

SET_TARGET_PROPERTIES(fann PROPERTIES VERSION ${VERSION} SOVERSION 2 )
INSTALL(TARGETS fann DESTINATION ${LIB_INSTALL_DIR} )
INSTALL(TARGETS fann LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
RUNTIME DESTINATION ${BIN_INSTALL_DIR} )

2 changes: 1 addition & 1 deletion src/include/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
########### install files ###############

INSTALL_FILES( /include FILES fann.h doublefann.h fann_internal.h floatfann.h fann_data.h fixedfann.h compat_time.h fann_activation.h fann_cascade.h fann_error.h fann_train.h fann_io.h fann_cpp.h )
INSTALL_FILES( /include FILES fann.h doublefann.h fann_internal.h floatfann.h fann_data.h fixedfann.h fann_activation.h fann_cascade.h fann_error.h fann_train.h fann_io.h fann_cpp.h )

0 comments on commit 4fcc76f

Please sign in to comment.