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 #=========================================================
14 #Support for the CTest dashboard testing system
16 #=========================================================
18 #=========================================================
22 INCLUDE("${ITK_USE_FILE}")
25 "Cannot build without ITK. Please set ITK_DIR.")
27 #=========================================================
29 #=========================================================
31 FIND_PACKAGE(VTK REQUIRED)
33 INCLUDE("${VTK_USE_FILE}")
35 MESSAGE(FATAL_ERROR "Please set VTK_DIR.")
37 #=========================================================
39 #=========================================================
41 FIND_PATH(CLITK_GENGETOPT gengetopt)
42 IF (CLITK_GENGETOPT STREQUAL "CLITK_GENGETOPT-NOTFOUND")
43 MESSAGE("gengetopt not found, please install it (see http://www.gnu.org/software/gengetopt/gengetopt.html)")
44 ENDIF (CLITK_GENGETOPT STREQUAL "CLITK_GENGETOPT-NOTFOUND")
45 #=========================================================
47 #=========================================================
48 # Building in the source tree is forbidden
49 IF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
50 MESSAGE(FATAL_ERROR "Building in the source tree is not allowed ! Quit; remove the file 'CMakeCache.txt' and the folder 'CMakeFiles' an
51 d build outside the sources (for example 'mkdir build ; cmake <CLITK_DIR>'.")
52 ENDIF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
53 #=========================================================
55 #=========================================================
56 # Remove some MS Visual c++ flags
58 ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS)
60 #=========================================================
62 #=========================================================
63 INCLUDE_DIRECTORIES(itk filters segmentation registration tools ${PROJECT_BINARY_DIR})
65 # Select what is compiled
66 ADD_SUBDIRECTORY(common)
67 add_subdirectory(tools)
68 add_subdirectory(segmentation)
69 add_subdirectory(registration)
72 OPTION(CLITK_EXPERIMENTAL "Enable experimental software and features" OFF)
73 OPTION(CLITK_BUILD_TOOLS "Build command-line tools" OFF)
74 OPTION(CLITK_BUILD_SEGMENTATION "Build command-line segmentation tools" OFF)
75 OPTION(CLITK_BUILD_REGISTRATION "Build command-line registration tools" OFF)
76 OPTION(CLITK_MEMORY_INFO "Enable memory information" OFF)
78 OPTION(CLITK_BUILD_VV "Build vv the 4D visualizer (requires VTK and QT)" ON)
83 #=========================================================