forked from NIRALUser/ARCTIC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
88 lines (75 loc) · 2.66 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
PROJECT(ARCTIC)
# Project: ARCTIC (Automatic Regional Cortical ThICkness)
cmake_minimum_required(VERSION 2.6)
IF(CMAKE_COMPILER_2005)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
ENDIF(CMAKE_COMPILER_2005)
IF (${CMAKE_SOURCE_DIR} STREQUAL ${ARCTIC_SOURCE_DIR})
SET (LIBRARY_OUTPUT_PATH ${ARCTIC_BINARY_DIR}/lib CACHE PATH "Single output directory for building all libraries.")
SET (EXECUTABLE_OUTPUT_PATH ${ARCTIC_BINARY_DIR}/bin CACHE PATH "Single output directory for building all executables.")
ENDIF (${CMAKE_SOURCE_DIR} STREQUAL ${ARCTIC_SOURCE_DIR})
#-----------------------------------------------------------------------------
# Configure Dart testing support.
OPTION(BUILD_TESTING "Compile Testing." OFF)
IF(BUILD_TESTING)
ENABLE_TESTING()
INCLUDE(CTest)
ENDIF(BUILD_TESTING)
FIND_PACKAGE(BatchMake REQUIRED)
INCLUDE(${BatchMake_USE_FILE})
FIND_PACKAGE(Slicer3 QUIET NO_DEFAULT_PATH)
IF(Slicer3_FOUND)
INCLUDE(${Slicer3_USE_FILE})
slicer3_set_default_install_prefix_for_external_projects()
ELSE(Slicer3_FOUND)
FIND_PACKAGE(SlicerExecutionModel REQUIRED)
IF (SlicerExecutionModel_FOUND)
INCLUDE(${SlicerExecutionModel_USE_FILE})
INCLUDE(${GenerateCLP_USE_FILE})
ENDIF(SlicerExecutionModel_FOUND)
FIND_PACKAGE(ITK REQUIRED)
IF (ITK_FOUND)
INCLUDE(${ITK_USE_FILE})
ELSE(ITK_FOUND)
MESSAGE(FATAL_ERROR, "ITK not found. Please set ITK_DIR.")
ENDIF (ITK_FOUND)
FIND_PACKAGE(VTK REQUIRED)
IF (VTK_FOUND)
INCLUDE(${VTK_USE_FILE})
ELSE(VTK_FOUND)
MESSAGE(FATAL_ERROR Please set VTK_DIR.)
ENDIF (VTK_FOUND)
ENDIF(Slicer3_FOUND)
OPTION(COMPILE_ImageStat "Compile ImageStat." ON)
IF( COMPILE_ImageStat )
SUBDIRS(ImageStat)
ENDIF()
OPTION(COMPILE_ImageMath "Compile ImageMath." ON)
IF( COMPILE_ImageMath )
SUBDIRS(ImageMath)
ENDIF()
OPTION(COMPILE_SegPostProcess "Compile SegPostProcess." ON)
IF( COMPILE_SegPostProcess )
SUBDIRS(SegPostProcess)
ENDIF()
OPTION(COMPILE_CortThick "Compile CortThick." ON)
IF( COMPILE_CortThick )
SUBDIRS(CortThick)
ENDIF()
OPTION(COMPILE_ITKEMS "Compile ITKEMS." ON)
IF( COMPILE_ITKEMS )
SUBDIRS(itkEMS)
ENDIF()
OPTION(COMPILE_ARCTIC "Compile ARCTIC." ON)
IF( COMPILE_ARCTIC )
SET (ARCTIC_SOURCE ARCTIC.cxx ARCTICParameters.cxx ARCTICComputation.cxx)
GENERATECLP(ARCTIC.cxx ARCTIC.xml)
ADD_EXECUTABLE ( ARCTIC ${ARCTIC_SOURCE})
TARGET_LINK_LIBRARIES ( ARCTIC ${ITK_LIBRARIES} ${BatchMake_LIBRARIES})
ADD_TEST(ARCTICTest1 ${LIBRARY_OUTPUT_PATH}/Slicer3/Plugins/ARCTIC --help)
ADD_TEST(ARCTICTest2 ${LIBRARY_OUTPUT_PATH}/Slicer3/Plugins/ARCTIC --version)
IF(Slicer3_FOUND)
slicer3_set_plugins_output_path(ARCTIC)
slicer3_install_plugins(ARCTIC)
ENDIF()
ENDIF()