-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathUseOTB.cmake
30 lines (23 loc) · 1.4 KB
/
UseOTB.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
# This file sets up include directories, link directories, and
# compiler settings for a project to use OTB. It should not be
# included directly, but rather through the OTB_USE_FILE setting
# obtained from OTBConfig.cmake.
# Add compiler flags needed to use OTB.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OTB_REQUIRED_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OTB_REQUIRED_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OTB_REQUIRED_LINK_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${OTB_REQUIRED_LINK_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${OTB_REQUIRED_LINK_FLAGS}")
# Add include directories needed to use OTB.
include_directories(${OTB_INCLUDE_DIRS})
# Add link directories needed to use OTB.
link_directories(${OTB_LIBRARY_DIRS})
# find_package() are already done (in OTBConfig.cmake)
# perform include(UseFile) for all external dependencies
# ITK : don't call UseFile to avoid the include_directorties(BEFORE ...)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ITK_REQUIRED_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ITK_REQUIRED_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${ITK_REQUIRED_LINK_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${ITK_REQUIRED_LINK_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${ITK_REQUIRED_LINK_FLAGS}")
# OpenCV : no USE_FILE defined