forked from libfann/fann
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
99 lines (76 loc) · 3.41 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
FIND_PACKAGE(OpenMP)
IF(OPENMP_FOUND)
OPTION(DISABLE_PARALLEL_FANN "Disable parallel fann functions" OFF)
ENDIF(OPENMP_FOUND)
IF(NOT OPENMP_FOUND OR DISABLE_PARALLEL_FANN)
ADD_DEFINITIONS(-DDISABLE_PARALLEL_FANN)
ELSE()
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
ENDIF(NOT OPENMP_FOUND OR DISABLE_PARALLEL_FANN)
ADD_SUBDIRECTORY( include )
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
ADD_DEFINITIONS(-D_REENTRANT)
if (WIN32)
ADD_DEFINITIONS(-DFANN_DLL_EXPORTS)
endif (WIN32)
########### next target ###############
SET(floatfann_LIB_SRCS
floatfann.c
)
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})
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
)
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})
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
)
ADD_LIBRARY(fixedfann SHARED ${fixedfann_LIB_SRCS})
ADD_LIBRARY(fixedfann_static STATIC ${fixedfann_LIB_SRCS})
TARGET_LINK_LIBRARIES(fixedfann m)
TARGET_LINK_LIBRARIES(fixedfann_static m)
SET_TARGET_PROPERTIES(fixedfann PROPERTIES VERSION ${FANN_VERSION_STRING} SOVERSION ${FANN_VERSION_MAJOR})
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
)
ADD_LIBRARY(fann SHARED ${fann_LIB_SRCS})
ADD_LIBRARY(fann_static STATIC ${fann_LIB_SRCS})
TARGET_LINK_LIBRARIES(fann m)
TARGET_LINK_LIBRARIES(fann_static m)
SET_TARGET_PROPERTIES(fann PROPERTIES VERSION ${FANN_VERSION_STRING} SOVERSION ${FANN_VERSION_MAJOR})
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} )