]> Creatis software - clitk.git/blob - CMakeLists.txt
*** empty log message ***
[clitk.git] / CMakeLists.txt
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)
8 PROJECT(clitk)
9 #=========================================================
10
11 #=========================================================
12 INCLUDE(cmake/common.cmake)
13 #=========================================================
14 #Support for the CTest dashboard testing system
15 INCLUDE(CTest)
16 #=========================================================
17
18 #=========================================================
19 # Find ITK (required)
20 FIND_PACKAGE(ITK)
21 IF(ITK_FOUND)
22   INCLUDE("${ITK_USE_FILE}")
23 ELSE(ITK_FOUND)
24   MESSAGE(FATAL_ERROR
25           "Cannot build without ITK.  Please set ITK_DIR.")
26 ENDIF(ITK_FOUND)
27 #=========================================================
28
29 #=========================================================
30 # Find VTK (required)
31 FIND_PACKAGE(VTK REQUIRED)
32 IF(VTK_FOUND)
33   INCLUDE("${VTK_USE_FILE}")
34 ELSE(VTK_FOUND)
35   MESSAGE(FATAL_ERROR "Please set VTK_DIR.")
36 ENDIF(VTK_FOUND)
37 #=========================================================
38
39 #=========================================================
40 # Find gengetopt
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 #=========================================================
46
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 #=========================================================
54
55 #=========================================================
56 # Remove some MS Visual c++ flags
57 IF(MSVC)
58   ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS)
59 ENDIF(MSVC)
60 #=========================================================
61
62 #=========================================================
63 INCLUDE_DIRECTORIES(itk filters segmentation registration tools ${PROJECT_BINARY_DIR})
64
65 # Select what is compiled
66 ADD_SUBDIRECTORY(common)
67 add_subdirectory(tools)
68 add_subdirectory(segmentation)
69 add_subdirectory(registration)
70
71 # Compilation options
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)
77
78 OPTION(CLITK_BUILD_VV "Build vv the 4D visualizer (requires VTK and QT)" ON)
79 IF (CLITK_BUILD_VV)
80   add_subdirectory(vv)
81 ENDIF(CLITK_BUILD_VV)
82
83 #=========================================================
84