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