Skip to content

Commit

Permalink
cmake changes
Browse files Browse the repository at this point in the history
  • Loading branch information
steffennissen committed Nov 29, 2015
1 parent 8ae6bb0 commit 889de34
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 37 deletions.
86 changes: 50 additions & 36 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,76 +10,90 @@ ELSE()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
ENDIF(NOT OPENMP_FOUND OR DISABLE_PARALLEL_FANN)

ADD_SUBDIRECTORY( include )
ADD_SUBDIRECTORY( include )

INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/include)
ADD_DEFINITIONS(-D_REENTRANT)
if (WIN32)
ADD_DEFINITIONS(-DFANN_DLL_EXPORTS)
ADD_DEFINITIONS(-DFANN_DLL_EXPORTS)
endif (WIN32)
########### next target ###############

SET(floatfann_LIB_SRCS
floatfann.c
parallel_floatfann_cpp.cpp
)
floatfann.c
)

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

SET_TARGET_PROPERTIES(floatfann PROPERTIES VERSION ${FANN_VERSION_STRING} SOVERSION ${FANN_VERSION_MAJOR})
INSTALL(TARGETS floatfann LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
RUNTIME DESTINATION ${BIN_INSTALL_DIR} )
SET_TARGET_PROPERTIES(floatfann_static PROPERTIES VERSION ${FANN_VERSION_STRING} SOVERSION ${FANN_VERSION_MAJOR})
if (UNIX)
SET_TARGET_PROPERTIES(floatfann_static PROPERTIES OUTPUT_NAME floatfann)
endif(UNIX)
INSTALL(TARGETS floatfann floatfann_static LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
RUNTIME DESTINATION ${BIN_INSTALL_DIR} )


########### next target ###############

SET(doublefann_LIB_SRCS
doublefann.c
parallel_doublefann_cpp.cpp
)
doublefann.c
)

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

SET_TARGET_PROPERTIES(doublefann PROPERTIES VERSION ${FANN_VERSION_STRING} SOVERSION ${FANN_VERSION_MAJOR})
INSTALL(TARGETS doublefann LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
RUNTIME DESTINATION ${BIN_INSTALL_DIR} )
SET_TARGET_PROPERTIES(doublefann_static PROPERTIES VERSION ${FANN_VERSION_STRING} SOVERSION ${FANN_VERSION_MAJOR})
if (UNIX)
SET_TARGET_PROPERTIES(doublefann_static PROPERTIES OUTPUT_NAME doublefann)
endif(UNIX)
INSTALL(TARGETS doublefann doublefann_static LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
RUNTIME DESTINATION ${BIN_INSTALL_DIR} )


########### next target ###############

SET(fixedfann_LIB_SRCS
fixedfann.c
)
fixedfann.c
)

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

if(NOT WIN32)
TARGET_LINK_LIBRARIES(fixedfann m)
endif()
TARGET_LINK_LIBRARIES(fixedfann m)
TARGET_LINK_LIBRARIES(fixedfann_static m)

SET_TARGET_PROPERTIES(fixedfann PROPERTIES VERSION ${FANN_VERSION_STRING} SOVERSION ${FANN_VERSION_MAJOR})
INSTALL(TARGETS fixedfann LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
RUNTIME DESTINATION ${BIN_INSTALL_DIR} )
SET_TARGET_PROPERTIES(fixedfann_static PROPERTIES VERSION ${FANN_VERSION_STRING} SOVERSION ${FANN_VERSION_MAJOR})
if (UNIX)
SET_TARGET_PROPERTIES(fixedfann_static PROPERTIES OUTPUT_NAME fixedfann)
endif(UNIX)
INSTALL(TARGETS fixedfann fixedfann_static LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
RUNTIME DESTINATION ${BIN_INSTALL_DIR} )


########### next target ###############

SET(fann_LIB_SRCS
floatfann.c
parallel_floatfann_cpp.cpp
)
floatfann.c
)

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

if(NOT WIN32)
TARGET_LINK_LIBRARIES(fann m)
endif()
TARGET_LINK_LIBRARIES(fann m)
TARGET_LINK_LIBRARIES(fann_static m)

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

SET_TARGET_PROPERTIES(fann_static PROPERTIES VERSION ${FANN_VERSION_STRING} SOVERSION ${FANN_VERSION_MAJOR})
if (UNIX)
SET_TARGET_PROPERTIES(fann_static PROPERTIES OUTPUT_NAME fann)
endif(UNIX)
INSTALL(TARGETS fann fann_static LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
RUNTIME DESTINATION ${BIN_INSTALL_DIR} )
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/lib/googletest/include)
CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
if(COMPILER_SUPPORTS_CXX14)
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has C++14 support.")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
elseif(COMPILER_SUPPORTS_CXX11)
Expand Down

0 comments on commit 889de34

Please sign in to comment.