1 #=========================================================
2 # CLITK = Command Line ITK
3 cmake_minimum_required(VERSION 2.4)
4 cmake_policy(VERSION 2.4)
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)
21 ADD_SUBDIRECTORY(tests)
23 #=========================================================
25 #=========================================================
29 INCLUDE("${ITK_USE_FILE}")
31 MESSAGE(FATAL_ERROR "Cannot build without ITK. Please set ITK_DIR.")
33 #=========================================================
35 #=========================================================
37 FIND_PACKAGE(VTK REQUIRED)
39 INCLUDE("${VTK_USE_FILE}")
41 MESSAGE(FATAL_ERROR "Please set VTK_DIR.")
43 #=========================================================
45 #=========================================================
47 FIND_PATH(CLITK_GENGETOPT gengetopt)
48 IF (CLITK_GENGETOPT STREQUAL "CLITK_GENGETOPT-NOTFOUND")
49 MESSAGE("gengetopt not found, please install it (see http://www.gnu.org/software/gengetopt/gengetopt.html)")
50 ENDIF (CLITK_GENGETOPT STREQUAL "CLITK_GENGETOPT-NOTFOUND")
51 #=========================================================
53 #=========================================================
54 # Find libstatgrab is installed, add clitkMemoryUsage.cxx in the library
55 FIND_LIBRARY(LIBSTATGRAB NAMES statgrab PATHS)
56 IF (${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")
57 # MESSAGE("Install libstatgrab (http://www.i-scream.org/libstatgrab/) for memory usage information")
58 SET(CLITK_MEMORY_INFO OFF)
59 ELSE (${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")
60 SET(CLITK_MEMORY_INFO ON)
61 ENDIF (${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")
62 #=========================================================
64 #=========================================================
65 # If the user choose to build documentation, then search for Doxygen executables.
66 OPTION(BUILD_DOXYGEN "Build Doxygen Documentation" OFF)
69 ADD_SUBDIRECTORY(Doxygen)
71 #=========================================================
73 #=========================================================
74 # Building in the source tree is forbidden
75 IF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
76 MESSAGE(FATAL_ERROR "Building in the source tree is not allowed ! Quit; remove the file 'CMakeCache.txt' and the folder 'CMakeFiles' an
77 d build outside the sources (for example 'mkdir build ; cmake <CLITK_DIR>'.")
78 ENDIF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
79 #=========================================================
81 #=========================================================
82 # Remove some MS Visual c++ flags
84 ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS)
86 #=========================================================
88 #=========================================================
89 INCLUDE_DIRECTORIES(itk filters segmentation registration tools ${PROJECT_BINARY_DIR})
91 # Select what is compiled
92 ADD_SUBDIRECTORY(common)
93 add_subdirectory(tools)
94 add_subdirectory(segmentation)
95 add_subdirectory(registration)
99 OPTION(CLITK_EXPERIMENTAL "Enable experimental software and features" OFF)
100 OPTION(CLITK_BUILD_TOOLS "Build command-line tools" OFF)
101 OPTION(CLITK_BUILD_SEGMENTATION "Build command-line segmentation tools" OFF)
102 OPTION(CLITK_BUILD_REGISTRATION "Build command-line registration tools" OFF)
104 OPTION(CLITK_BUILD_VV "Build vv the 4D visualizer (requires VTK and QT)" ON)
107 ENDIF(CLITK_BUILD_VV)
110 #=========================================================