Newer
Older
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
cmake_minimum_required( VERSION 2.8 )
#---------------------------------------------------------------------
# Prerequisites
find_package( Git REQUIRED )
include( ExternalProject )
enable_language(C)
enable_language(CXX)
set( CMAKE_MODULE_PATH
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../CMake
${CMAKE_MODULE_PATH}
)
#---------------------------------------------------------------------
# Elastix SuperBuild configuration
# Build release by default
if( NOT DEFINED CMAKE_BUILD_TYPE )
set( CMAKE_BUILD_TYPE "Release" )
endif()
# Build examples by default
# Examples will be build as an external project to verify the installation of elastix
option( ELASTIX_BUILD_EXAMPLES "Enable building examples." ON )
# Do not build testing by default since this requires GoogleTest submodule to be initialized
option( ELASTIX_BUILD_TESTING "Enable building tests." OFF )
if( ELASTIX_BUILD_TESTING )
mark_as_advanced( ELASTIX_BUILD_CTESTS )
option( ELASTIX_BUILD_CTESTS "Enable CTests." OFF )
endif()
#---------------------------------------------------------------------
# Build ITK as external project
set( ITK_VERSION_MAJOR "4" )
set( ITK_VERSION_MINOR "7" )
set( ITK_VERSION_PATCH "1" )
set( ITK_VERSION_STRING "${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}.${ITK_VERSION_PATCH}" )
mark_as_advanced( USE_SYSTEM_ITK )
option( USE_SYSTEM_ITK "Use an installed version of ITK" OFF )
if( USE_SYSTEM_ITK )
find_package( ITK ${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR} REQUIRED )
include( "${CMAKE_CURRENT_SOURCE_DIR}/../CMake/elxRequiredITKModules.cmake" )
else()
include( ExternalITK )
list( APPEND ELASTIX_DEPENDENCIES ITK )
endif()
#---------------------------------------------------------------------
# Build Elastix as an external project
include( Elastix )