-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathCMakeLists.txt
107 lines (86 loc) · 3.38 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
# CMakeFiles.txt for the minc-tools
#
# Andrew Janke - [email protected]
# Vladimir S. FONOV - [email protected]
PROJECT(minc-tools)
SET(MINC_TOOLS_PACKAGE_VERSION_MAJOR 2)
SET(MINC_TOOLS_PACKAGE_VERSION_MINOR 3)
SET(MINC_TOOLS_PACKAGE_VERSION_PATCH 01)
SET(PACKAGE "minc-tools")
SET(PACKAGE_BUGREPORT "[email protected]")
SET(PACKAGE_NAME "minc-tools")
SET(PACKAGE_VERSION "${MINC_TOOLS_PACKAGE_VERSION_MAJOR}.${MINC_TOOLS_PACKAGE_VERSION_MINOR}.${MINC_TOOLS_PACKAGE_VERSION_PATCH}")
SET(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
ENABLE_TESTING()
INCLUDE(CTest)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
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)
IF(MINC_TOOLKIT_BUILD)
SET(MINC_TOOLS_EXTERNALLY_CONFIGURED ON)
ENDIF(MINC_TOOLKIT_BUILD)
IF(NOT MINC_TOOLS_EXTERNALLY_CONFIGURED)
SET(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules")
SET(CPACK_GENERATOR TGZ)
SET(CPACK_PACKAGE_VERSION_MAJOR ${MINC_TOOLS_PACKAGE_VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${MINC_TOOLS_PACKAGE_VERSION_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${MINC_TOOLS_PACKAGE_VERSION_PATCH})
INCLUDE(CPack)
FIND_PACKAGE(LIBMINC REQUIRED)
ENDIF(NOT MINC_TOOLS_EXTERNALLY_CONFIGURED)
INCLUDE( ${LIBMINC_USE_FILE} )
INCLUDE( InstallManPages )
# check for prereqs
INCLUDE(CheckFunctionExists)
CHECK_FUNCTION_EXISTS(mkstemp HAVE_MKSTEMP)
CHECK_FUNCTION_EXISTS(tmpnam HAVE_TMPNAM)
CHECK_FUNCTION_EXISTS(tempnam HAVE_TEMPNAM)
CHECK_FUNCTION_EXISTS(strerror HAVE_STRERROR)
CHECK_FUNCTION_EXISTS(popen HAVE_POPEN)
CHECK_FUNCTION_EXISTS(fork HAVE_WORKING_FORK)
CHECK_FUNCTION_EXISTS(vfork HAVE_WORKING_VFORK)
CHECK_FUNCTION_EXISTS(fdopen HAVE_FDOPEN)
CHECK_FUNCTION_EXISTS(strdup HAVE_STRDUP)
CHECK_FUNCTION_EXISTS(getpwnam HAVE_GETPWNAM)
CHECK_FUNCTION_EXISTS(select HAVE_SELECT)
CHECK_FUNCTION_EXISTS(strerror HAVE_STRERROR)
CHECK_FUNCTION_EXISTS(sysconf HAVE_SYSCONF)
CHECK_FUNCTION_EXISTS(system HAVE_SYSTEM)
INCLUDE(CheckIncludeFiles)
CHECK_INCLUDE_FILES(float.h HAVE_FLOAT_H)
CHECK_INCLUDE_FILES(sys/dir.h HAVE_SYS_DIR_H)
CHECK_INCLUDE_FILES(sys/ndir.h HAVE_SYS_NDIR_H)
CHECK_INCLUDE_FILES(sys/stat.h HAVE_SYS_STAT_H)
CHECK_INCLUDE_FILES(sys/types.h HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILES(sys/wait.h HAVE_SYS_WAIT_H)
CHECK_INCLUDE_FILES(values.h HAVE_VALUES_H)
CHECK_INCLUDE_FILES(unistd.h HAVE_UNISTD_H)
CHECK_INCLUDE_FILES(dirent.h HAVE_DIRENT_H)
CHECK_INCLUDE_FILES(memory.h HAVE_MEMORY_H)
CHECK_INCLUDE_FILES(stdlib.h HAVE_STDLIB_H)
CHECK_INCLUDE_FILES(fcntl.h HAVE_FCNTL_H)
CHECK_INCLUDE_FILES(dlfcn.h HAVE_DLFCN_H)
CHECK_INCLUDE_FILES(vfork.h HAVE_VFORK_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)
CHECK_INCLUDE_FILES(pwd.h HAVE_PWD_H)
ADD_DEFINITIONS(-DHAVE_CONFIG_H)
# aliases
SET(VERSION "${PACKAGE_VERSION}")
# netcdf and HDF5
# config files for build
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h @ONLY)
# set the master INCLUDE directories
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}
)
ADD_SUBDIRECTORY( progs )
ADD_SUBDIRECTORY( conversion )
# testing
IF(BUILD_TESTING)
ADD_SUBDIRECTORY( Testing )
ENDIF(BUILD_TESTING)