1 #=========================================================
2 # CLITK = Command Line ITK
3 cmake_minimum_required(VERSION 2.8)
4 cmake_policy(VERSION 2.8)
5 if(COMMAND cmake_policy)
6 cmake_policy(SET CMP0003 NEW)
7 endif(COMMAND cmake_policy)
9 #=========================================================
11 #=========================================================
12 INCLUDE(cmake/common.cmake)
13 #=========================================================
15 #=========================================================
16 #Support for the CTest dashboard testing system
17 OPTION(BUILD_TESTING "Build the testing tree" OFF)
19 OPTION(CLITK_BUILD_TESTING "Test ITK" ON)
22 #=========================================================
24 #=========================================================
28 INCLUDE("${ITK_USE_FILE}")
30 MESSAGE(FATAL_ERROR "Cannot build without ITK. Please set ITK_DIR.")
32 #=========================================================
34 #=========================================================
36 FIND_PACKAGE(VTK REQUIRED)
38 INCLUDE("${VTK_USE_FILE}")
40 MESSAGE(FATAL_ERROR "Please set VTK_DIR.")
42 #=========================================================
44 #=========================================================
45 # Find gengetopt, will create a target exe if not found
46 SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
47 FIND_PACKAGE(Gengetopt)
48 #=========================================================
50 #=========================================================
51 # Find libstatgrab is installed, add clitkMemoryUsage.cxx in the library
52 FIND_LIBRARY(LIBSTATGRAB NAMES statgrab PATHS)
53 IF (${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")
54 # MESSAGE("Install libstatgrab (http://www.i-scream.org/libstatgrab/) for memory usage information")
55 SET(CLITK_MEMORY_INFO OFF)
56 ELSE (${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")
57 SET(CLITK_MEMORY_INFO ON)
58 ENDIF (${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")
59 #=========================================================
61 #=========================================================
62 # If the user choose to build documentation, then search for Doxygen executables.
63 OPTION(BUILD_DOXYGEN "Build Doxygen Documentation" OFF)
66 ADD_SUBDIRECTORY(Doxygen)
68 #=========================================================
70 #=========================================================
71 # Building in the source tree is forbidden
72 IF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
73 MESSAGE(FATAL_ERROR "Building in the source tree is not allowed ! Quit; remove the file 'CMakeCache.txt' and the folder 'CMakeFiles' an
74 d build outside the sources (for example 'mkdir build ; cmake <CLITK_DIR>'.")
75 ENDIF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
76 #=========================================================
78 #=========================================================
79 # Remove some MS Visual c++ flags
81 ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS)
83 #=========================================================
85 #=========================================================
86 INCLUDE_DIRECTORIES(itk filters segmentation registration tools ${PROJECT_BINARY_DIR})
88 # Select what is compiled
89 ADD_SUBDIRECTORY(common)
90 ADD_SUBDIRECTORY(tools)
91 ADD_SUBDIRECTORY(segmentation)
92 ADD_SUBDIRECTORY(registration)
96 OPTION(CLITK_EXPERIMENTAL "Enable experimental software and features" OFF)
97 OPTION(CLITK_BUILD_TOOLS "Build command-line tools" OFF)
98 OPTION(CLITK_BUILD_SEGMENTATION "Build command-line segmentation tools" OFF)
99 OPTION(CLITK_BUILD_REGISTRATION "Build command-line registration tools" OFF)
101 OPTION(CLITK_BUILD_VV "Build vv the 4D visualizer (requires VTK and QT)" ON)
104 ENDIF(CLITK_BUILD_VV)
107 #=========================================================
108 # Build test when vv has been compiled
110 ADD_SUBDIRECTORY(tests)
113 #=========================================================
114 # Install scripts when running make install
116 scripts/calculate_motion_amplitude.sh
117 scripts/midp_common.sh
118 scripts/registration.sh
119 scripts/create_midP.sh
120 scripts/create_midP-2.0.sh
121 scripts/create_mhd_4D.sh
122 scripts/create_mhd_4D_pattern.sh
123 scripts/create_midP_masks.sh
124 scripts/create_midP_masks-2.0.sh
125 scripts/pts_to_landmarks.sh
126 scripts/create_mhd_3D.sh
127 scripts/create_sequence.sh
128 scripts/dcm_sort_by_field.sh
129 scripts/dicom_info.sh
132 INSTALL (FILES ${SCRIPTS} DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)