forked from Kitware/MetaIO
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
53 lines (44 loc) · 1.81 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
CMAKE_MINIMUM_REQUIRED( VERSION 2.6 )
SET( METAIO_FOR_ITK 1 )
SET( METAIO_NAMESPACE "ITKMetaIO" )
PROJECT( "ITKMetaIO" )
# 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()
ADD_SUBDIRECTORY( src )