-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathCMakeLists.txt
142 lines (105 loc) · 4.07 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# CMakeFiles.txt for the mni_autoreg library
#
# Vladimir S. FONOV - [email protected]
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
SET(MNI_AUTOREG_PACKAGE_VERSION_MAJOR 0)
SET(MNI_AUTOREG_PACKAGE_VERSION_MINOR 99)
SET(MNI_AUTOREG_PACKAGE_VERSION_PATCH 70)
SET(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules")
IF(NOT MINC_TOOLKIT_BUILD)
PROJECT(mni_autoreg)
# Packaging defines
SET(CPACK_GENERATOR TGZ)
SET(CPACK_PACKAGE_VERSION_MAJOR ${MNI_AUTOREG_PACKAGE_VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${MNI_AUTOREG_PACKAGE_VERSION_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${MNI_AUTOREG_PACKAGE_VERSION_PATCH})
INCLUDE(CPack)
FIND_PACKAGE( LIBMINC REQUIRED )
FIND_PACKAGE( Perl REQUIRED )
OPTION(MNI_AUTOREG_OLD_AMOEBA_INIT "Use old-style (asymmetric) amoeba init" OFF)
FIND_PACKAGE( LIBLBFGS QUIET )
SET(MINC_TEST_ENVIRONMENT
"PATH=${CMAKE_CURRENT_BINARY_DIR}/mincblur:${CMAKE_CURRENT_BINARY_DIR}/make_phantom:${CMAKE_CURRENT_BINARY_DIR}/minctracc:$ENV{PATH}"
)
INCLUDE(InstallManPages)
ENDIF(NOT MINC_TOOLKIT_BUILD)
IF(COMMAND CMAKE_POLICY)
IF(POLICY CMP0026)
CMAKE_POLICY(SET CMP0026 OLD) # NEEDED in testing to read location of target
ENDIF(POLICY CMP0026)
ENDIF(COMMAND CMAKE_POLICY)
INCLUDE( ${LIBMINC_USE_FILE} )
ENABLE_TESTING()
INCLUDE(CTest)
SET(PACKAGE "mni_autoreg")
SET(PACKAGE_BUGREPORT "[email protected]")
SET(PACKAGE_NAME "mni_autoreg")
SET(PACKAGE_VERSION "${MNI_AUTOREG_PACKAGE_VERSION_MAJOR}.${MNI_AUTOREG_PACKAGE_VERSION_MINOR}.${MNI_AUTOREG_PACKAGE_VERSION_PATCH}")
SET(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
INCLUDE( ${LIBMINC_USE_FILE} )
ADD_DEFINITIONS(-DHAVE_CONFIG_H)
IF(NOT APPLE)
ADD_DEFINITIONS(-D_XOPEN_SOURCE=500)
ENDIF(NOT APPLE)
set(CMAKE_MACOSX_RPATH ON)
# aliases
SET(VERSION "${PACKAGE_VERSION}")
IF(MINC_TOOLKIT_BUILD)
SET(MNI_AUTOREG_EXTERNALLY_CONFIGURED ON)
ENDIF(MINC_TOOLKIT_BUILD)
IF(NOT MNI_AUTOREG_EXTERNALLY_CONFIGURED)
OPTION(MNI_AUTOREG_BUILD_SHARED_LIBS "Build mni_autoreg with shared libraries." OFF)
ELSE(NOT MNI_AUTOREG_EXTERNALLY_CONFIGURED)
SET(MNI_AUTOREG_BUILD_SHARED_LIBS ${MT_BUILD_SHARED_LIBS})
ENDIF(NOT MNI_AUTOREG_EXTERNALLY_CONFIGURED)
IF(MNI_AUTOREG_BUILD_SHARED_LIBS)
SET(LIBRARY_TYPE SHARED)
SET(LIBRARY_INSTALL LIBRARY)
ELSE(MNI_AUTOREG_BUILD_SHARED_LIBS)
SET(LIBRARY_TYPE STATIC)
SET(LIBRARY_INSTALL ARCHIVE)
ENDIF(MNI_AUTOREG_BUILD_SHARED_LIBS)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fcommon")
# check for prereqs
INCLUDE(CheckIncludeFiles)
CHECK_INCLUDE_FILES(float.h HAVE_FLOAT_H)
CHECK_INCLUDE_FILES(limits.h HAVE_LIMITS_H)
CHECK_INCLUDE_FILES(sys/stat.h HAVE_SYS_STAT_H)
CHECK_INCLUDE_FILES(sys/types.h HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILES(values.h HAVE_VALUES_H)
CHECK_INCLUDE_FILES(unistd.h HAVE_UNISTD_H)
CHECK_INCLUDE_FILES(memory.h HAVE_MEMORY_H)
CHECK_INCLUDE_FILES(math.h HAVE_MATH_H)
CHECK_INCLUDE_FILES(malloc.h HAVE_MALLOC_H)
CHECK_INCLUDE_FILES(stdlib.h HAVE_STDLIB_H)
CHECK_INCLUDE_FILES(inttypes.h HAVE_INTTYPES_H)
CHECK_INCLUDE_FILES(string.h HAVE_STRING_H)
CHECK_INCLUDE_FILES(strings.h HAVE_STRINGS_H)
IF(LIBLBFGS_FOUND)
SET(HAVE_LIBLBFGS TRUE)
ENDIF(LIBLBFGS_FOUND)
SET(MNI_AUTOREG_COMPILE_DATETIME "")
SET(MNI_AUTOREG_COMPILE_USER "")
SET(MNI_AUTOREG_COMPILE_SYSTEM ${CMAKE_SYSTEM})
SET(MNI_AUTOREG_COMPILE_HOST "")
SET(MNI_AUTOREG_LONG_VERSION ${PACKAGE_STRING})
# others
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/epm-header.in ${CMAKE_CURRENT_BINARY_DIR}/epm-header)
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/Proglib)
LINK_LIBRARIES( ${VOLUME_IO_LIBRARIES} ${LIBMINC_LIBRARIES} )
ADD_SUBDIRECTORY(Proglib)
ADD_SUBDIRECTORY(make_phantom)
ADD_SUBDIRECTORY(mincbbox)
ADD_SUBDIRECTORY(mincblur )
ADD_SUBDIRECTORY(mincchamfer )
ADD_SUBDIRECTORY(minctracc )
ADD_SUBDIRECTORY(perl )
add_custom_target(
mni_autoreg ALL DEPENDS
minctracc mincblur make_phantom mincchamfer mincbbox
)
# testing
IF(BUILD_TESTING)
ADD_SUBDIRECTORY(Testing)
ENDIF(BUILD_TESTING)