-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
145 lines (112 loc) · 4.04 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
PROJECT(Ice)
cmake_minimum_required(VERSION 2.6)
set(Ice_VERSION_MAJOR "0")
set(Ice_VERSION_MINOR "4")
set(Ice_VERSION_PATCH "0")
set(CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/CMake
${CMAKE_MODULE_PATH})
include(CTest)
#----------------------------------------------------------------------------
# ensure WIN32 definition
if(WIN32)
add_definitions(-DWIN32)
endif(WIN32)
#----------------------------------------------------------------------------
#Prevents conflicts with visual min/max function
if(WIN32)
add_definitions(-DNOMINMAX)
add_definitions(
-D_CRT_FAR_MAPPINGS_NO_DEPRECATE
-D_CRT_IS_WCTYPE_NO_DEPRECATE
-D_CRT_MANAGED_FP_NO_DEPRECATE
-D_CRT_NONSTDC_NO_DEPRECATE
-D_CRT_SECURE_NO_DEPRECATE
-D_CRT_SECURE_NO_DEPRECATE_GLOBALS
-D_CRT_SETERRORMODE_BEEP_SLEEP_NO_DEPRECATE
-D_CRT_TIME_FUNCTIONS_NO_DEPRECATE
-D_CRT_VCCLRIT_NO_DEPRECATE
-D_SCL_SECURE_NO_DEPRECATE
)
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D_CRT_NONSTDC_NO_WARNING)
endif()
endif(WIN32)
OPTION(BUILD_ICE_APPLICATION "Build the Ice application (requires glfw and glut)" ON)
# include before OTB includes in case ice is already installed in the system (at otb install location)
include_directories(Code)
#----------------------------------------------------------------------------
# ITK
# find_package(ITK REQUIRED)
# if(ITK_FOUND)
# MESSAGE(STATUS "ITK found")
# include(${ITK_USE_FILE})
# else(ITK_FOUND)
# message(FATAL_ERROR "ITK not found. Please set ITK_DIR")
# endif(ITK_FOUND)
#----------------------------------------------------------------------------
# Orfeo ToolBox
find_package(OTB REQUIRED
COMPONENTS OTBImageIO OTBVectorDataIO OTBProjection OTBStatistics)
if(OTB_FOUND)
MESSAGE(STATUS "OTB found")
include(${OTB_USE_FILE})
else(OTB_FOUND)
message(FATAL_ERROR "OTB not found. Please set OTB_DIR")
endif(OTB_FOUND)
#----------------------------------------------------------------------------
# OpenGL (needed by Qt4)
find_package( OpenGL REQUIRED )
if (OPENGL_FOUND)
MESSAGE(STATUS "OpenGL found")
include_directories(${OPENGL_INCLUDE_DIR})
else (OPENGL_FOUND)
MESSAGE(FATAL_ERROR "OpenGL missing")
endif (OPENGL_FOUND)
find_package(GLEW REQUIRED)
if(GLEW_FOUND)
MESSAGE(STATUS "Glew found")
include_directories(${GLEW_INCLUDE_PATH})
else(GLEW_FOUND)
MESSAGE(FATAL_ERROR "Glew missing. Please set glew directories.")
endif(GLEW_FOUND)
if(BUILD_ICE_APPLICATION)
find_package(GLFW REQUIRED)
if(GLFW_FOUND)
MESSAGE(STATUS "GLFW found")
include_directories(${GLFW_INCLUDE_DIR})
else(GLFW_FOUND)
MESSAGE(FATAL_ERROR "GLFW missing. Please set glfw directories or deactivate the BUILD_ICE_APPLICATION option.")
endif(GLFW_FOUND)
find_package(GLUT REQUIRED)
if(GLUT_FOUND)
MESSAGE(STATUS "Glut found")
include_directories(${GLUT_INCLUDE_DIR})
else(GLUT_FOUND)
MESSAGE(FATAL_ERROR "Glut missing. Please set glut directories or deactivate the BUILD_ICE_APPLICATION option.")
endif(GLUT_FOUND)
endif(BUILD_ICE_APPLICATION)
SET(BUILD_SHARED_LIBS ${OTB_BUILD_SHARED})
set(Ice_LIBRARY_PROPERTIES
VERSION "${Ice_VERSION_MAJOR}.${Ice_VERSION_MINOR}.${Ice_VERSION_PATCH}"
SOVERSION "${Ice_VERSION_MAJOR}.${Ice_VERSION_MINOR}"
)
# Output directories
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${Ice_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for all ARCHIVE products (static libs, import libs)")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${Ice_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for all LIBRARY products (so, modules)")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${Ice_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for all RUNTIME products (executables, dlls)")
# Install dirs
if(NOT Ice_INSTALL_BIN_DIR)
set(Ice_INSTALL_BIN_DIR "bin")
endif(NOT Ice_INSTALL_BIN_DIR)
if(NOT Ice_INSTALL_LIB_DIR)
set(Ice_INSTALL_LIB_DIR "lib/")
endif(NOT Ice_INSTALL_LIB_DIR)
if(NOT Ice_INSTALL_INCLUDE_DIR)
set(Ice_INSTALL_INCLUDE_DIR "include/")
endif(NOT Ice_INSTALL_INCLUDE_DIR)
add_subdirectory(Code)
if(BUILD_ICE_APPLICATION)
add_subdirectory(Application)
endif(BUILD_ICE_APPLICATION)