OTBConfig.cmake.in 3.27 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#
# Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
#
# This file is part of Orfeo Toolbox
#
#     https://www.orfeo-toolbox.org/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

21
22
23
24
25
26
27
28
#-----------------------------------------------------------------------------
#
# OTBConfig.cmake - OTB CMake configuration file for external projects.
#
# This file is configured by OTB and used by the UseOTB.cmake module
# to load OTB's settings for an external project.
@OTB_CONFIG_CODE@

29
30
31
32
33
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
#RK: TODO: add sse2, see4, see4.1, openmp flags

34
35
36
37
38
39
40
41
42
43
# The C and C++ flags added by OTB to the cmake-configured flags.
set(OTB_REQUIRED_C_FLAGS "@OTB_REQUIRED_C_FLAGS@")
set(OTB_REQUIRED_CXX_FLAGS "@OTB_REQUIRED_CXX_FLAGS@")
set(OTB_REQUIRED_LINK_FLAGS "@OTB_REQUIRED_LINK_FLAGS@")

# The OTB version number
set(OTB_VERSION_MAJOR "@OTB_VERSION_MAJOR@")
set(OTB_VERSION_MINOR "@OTB_VERSION_MINOR@")
set(OTB_VERSION_PATCH "@OTB_VERSION_PATCH@")

44
45
46
# OTB's CMake directory with modules OTB uses.
set(OTB_CMAKE_DIR "@OTB_CONFIG_CMAKE_DIR@")

47
48
49
50
51
52
# OTB uses OPENMP
set(OTB_USE_OPENMP "@OTB_USE_OPENMP@")

# OTB uses SSE optim
set(OTB_USE_SSE_FLAGS "@OTB_USE_SSE_FLAGS@")

53
54
55
# use Find*.cmake files included in OTB package for external dependencies. (OpenCV, GDAL etc..)
set(CMAKE_MODULE_PATH ${OTB_CMAKE_DIR} ${CMAKE_MODULE_PATH})

56
57
58
59
60
61
# The location of the UseOTB.cmake file.
set(OTB_USE_FILE "@OTB_USE_FILE@")

# Whether OTB was built with shared libraries.
set(OTB_BUILD_SHARED "@BUILD_SHARED_LIBS@")

Rashad Kanavath's avatar
Rashad Kanavath committed
62
63
64
# Default value for WINDOWS_EXPORT_ALL_SYMBOLS target property
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS "@OTB_CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS@")

65
66
67
# List of available OTB modules.
set(OTB_MODULES_ENABLED "@OTB_CONFIG_MODULES_ENABLED@")

68
set(OTB_APPLICATION_PATH "@OTB_CONFIG_APPLICATION_PATH@")
69

70
71
72
73
74
75
76
77
78
79
# Import OTB targets.
set(OTB_CONFIG_TARGETS_FILE "@OTB_CONFIG_TARGETS_FILE@")
if(NOT OTB_TARGETS_IMPORTED@OTB_CONFIG_TARGETS_CONDITION@)
  set(OTB_TARGETS_IMPORTED 1)
  include("${OTB_CONFIG_TARGETS_FILE}")
endif()

# Load module interface macros.
include("@OTB_CONFIG_MODULE_API_FILE@")

80
81
82
83
# Load application macros.
include(CMakeParseArguments)
include("@OTB_CONFIG_APPLI_MACROS_FILE@")

84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Compute set of requested modules.
if(OTB_FIND_COMPONENTS)
  # Specific modules requested by find_package(OTB).
  set(OTB_MODULES_REQUESTED "${OTB_FIND_COMPONENTS}")
endif()
if(NOT OTB_MODULES_REQUESTED)
  # No specific modules requested.  Use all of them.
  set(OTB_MODULES_REQUESTED "${OTB_MODULES_ENABLED}")
endif()

# Load requested modules and their dependencies into variables:
#  OTB_LIBRARIES       = Libraries to link
#  OTB_INCLUDE_DIRS    = Header file search path
#  OTB_LIBRARY_DIRS    = Library search path (for outside dependencies)
otb_module_config(OTB ${OTB_MODULES_REQUESTED})