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