-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathSuperbuild.cmake
92 lines (73 loc) · 2.58 KB
/
Superbuild.cmake
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
88
89
90
91
92
find_package(Git)
if(NOT GIT_FOUND)
message(ERROR "Cannot find git. git is required for Superbuild")
endif()
option( USE_GIT_PROTOCOL "If behind a firewall turn this off to use http instead." ON)
set(git_protocol "git")
if(NOT USE_GIT_PROTOCOL)
set(git_protocol "http")
endif()
set( CMAKE_MODULE_PATH
${CMAKE_CURRENT_SOURCE_DIR}/../cmake
${CMAKE_MODULE_PATH}
)
include( ExternalProject )
# Compute -G arg for configuring external projects with the same CMake
# generator:
if(CMAKE_EXTRA_GENERATOR)
set(gen "${CMAKE_EXTRA_GENERATOR} - ${CMAKE_GENERATOR}")
else()
set(gen "${CMAKE_GENERATOR}" )
endif()
set( NewCore_DEPENDENCIES )
# ---------------------------------------------------------------------------------------------
# Boost with Boost.Log
#
option( BUILD_BOOST_WITH_LOG "Build Boost 1.49 along with Boost.Log" ON )
if( ${BUILD_BOOST_WITH_LOG} )
include( ${CMAKE_CURRENT_SOURCE_DIR}/External-Boost.cmake )
set( NewCore_DEPENDENCIES ${NewCore_DEPENDENCIES} boost )
endif()
# ---------------------------
# include( ${CMAKE_CURRENT_SOURCE_DIR}/External-Taucs.cmake )
# set( NewCore_DEPENDENCIES ${NewCore_DEPENDENCIES} Taucs )
# ---------------------------------------------------------------------------------------------
# OpenCV
#
set( OpenCV_RequiredVersion 2.3.1 )
find_package( OpenCV )
set( _processOpenCV false )
if( ${OpenCV_FOUND} )
if( ${OpenCV_VERSION} LESS ${OpenCV_RequiredVersion} )
message( "OpenCV found --- ${OpenCV_VERSION} ( < ${OpenCV_RequiredVersion} )" )
set( processOpenCV true )
else()
message( "OpenCV found --- ${OpenCV_VERSION} OK" )
set( _processOpenCV false )
set( OPENCV_DIR ${OpenCV_DIR} )
endif()
else()
message( "OpenCV not found" )
set( _processOpenCV true )
endif()
if( ${_processOpenCV} )
option( BUILD_OPENCV "Build OpenCV ${OpenCV_RequiredVersion}" ON )
if( ${BUILD_OPENCV} )
include( ${CMAKE_CURRENT_SOURCE_DIR}/External-OpenCV.cmake )
set( NewCore_DEPENDENCIES ${NewCore_DEPENDENCIES} opencv )
endif()
endif()
# ---------------------------------------------------------------------------------------------
# ITK With Bridge to OpenCV
#
option( BUILD_ITK "Build ITK v4.2" ON )
if( ${BUILD_ITK} )
include( ${CMAKE_CURRENT_SOURCE_DIR}/External-ITK.cmake )
set( NewCore_DEPENDENCIES ${NewCore_DEPENDENCIES} ITK )
endif()
# ---------------------------------------------------------------------------------------------
option( BUILD_TINYXML "Build TinyXML" ON )
if( ${BUILD_TINYXML} )
include( ${CMAKE_CURRENT_SOURCE_DIR}/External-TinyXML.cmake )
set( NewCore_DEPENDENCIES ${NewCore_DEPENDENCIES} TinyXML )
endif()