forked from Kitware/MetaIO
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
74 lines (63 loc) · 2.42 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
CMAKE_MINIMUM_REQUIRED( VERSION 2.6 )
SET( METAIO_FOR_ITK 1 )
SET( METAIO_NAMESPACE "ITKMetaIO" )
PROJECT( "ITKMetaIO" )
## Define language standard configurations requiring at least C++11 standard.
if(CMAKE_CXX_STANDARD EQUAL "98" )
message(FATAL_ERROR "CMAKE_CXX_STANDARD:STRING=98 is not supported.")
endif()
## Set the default target properties.
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 11) # Supported values are ``11``, ``14``, ``17``, etc.
endif()
if(NOT CMAKE_CXX_STANDARD_REQUIRED)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()
if(NOT CMAKE_CXX_EXTENSIONS)
set(CMAKE_CXX_EXTENSIONS OFF)
endif()
# When installing stand-alone version, it will use ITK's installation scripts
IF(NOT ITK_INSTALL_BIN_DIR)
SET(ITK_INSTALL_BIN_DIR "/bin")
ENDIF(NOT ITK_INSTALL_BIN_DIR)
STRING(REGEX REPLACE "^/" "" ITK_INSTALL_BIN_DIR_CM24 "${ITK_INSTALL_BIN_DIR}")
IF(NOT ITK_INSTALL_LIB_DIR)
SET(ITK_INSTALL_LIB_DIR "/lib/iktMetaIO")
ENDIF(NOT ITK_INSTALL_LIB_DIR)
STRING(REGEX REPLACE "^/" "" ITK_INSTALL_LIB_DIR_CM24 "${ITK_INSTALL_LIB_DIR}")
IF(NOT ITK_INSTALL_INCLUDE_DIR)
SET(ITK_INSTALL_INCLUDE_DIR "/include/iktMetaIO")
ENDIF(NOT ITK_INSTALL_INCLUDE_DIR)
STRING(REGEX REPLACE "^/" "" ITK_INSTALL_INCLUDE_DIR_CM24 "${ITK_INSTALL_INCLUDE_DIR}")
INCLUDE_DIRECTORIES( ${ITKMetaIO_SOURCE_DIR} )
INCLUDE_DIRECTORIES( ${ITKMetaIO_SOURCE_DIR}/src )
INCLUDE_DIRECTORIES( ${ITKMetaIO_BINARY_DIR} )
## Replicate ITK's way of dealing with system versions of zlib
## This makes a stand-alone installation of MetaIO incompatible with the
## ITK version of MetaIO...don't install both...bad things will happen.
INCLUDE( ${ITKMetaIO_SOURCE_DIR}/itkThirdParty.cmake )
CONFIGURE_FILE(${ITKMetaIO_SOURCE_DIR}/itkThirdParty.h.in
${ITKMetaIO_BINARY_DIR}/itkThirdParty.h @ONLY IMMEDIATE)
IF(NOT ITK_INSTALL_NO_DEVELOPMENT)
INSTALL(FILES
${ITKMetaIO_BINARY_DIR}/itkThirdParty.h
${ITKMetaIO_SOURCE_DIR}/itk_zlib.h
${ITKMetaIO_SOURCE_DIR}/metaIOConfig.h
DESTINATION ${ITK_INSTALL_INCLUDE_DIR_CM24}
COMPONENT Development
)
ENDIF(NOT ITK_INSTALL_NO_DEVELOPMENT)
ITK_THIRD_PARTY_OPTION( ZLIB zlib )
ITK_THIRD_PARTY_SUBDIR( ZLIB itkzlib )
if(ITK_USE_SYSTEM_ZLIB)
set(ZLIB_LIBRARIES z)
else()
link_directories(${CMAKE_CURRENT_BINARY_DIR}/itkzlib)
set(ZLIB_LIBRARIES itkzlib)
endif()
if(BUILD_TESTING)
ENABLE_TESTING()
else()
option(BUILD_TESTING "Build the testing tree" ${BUILD_TESTING})
endif()
ADD_SUBDIRECTORY( src )