#
# Copyright (C) 2005-2020 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.
#

#-----------------------------------------------------------------------------
#
# 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@

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

# 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@")

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

# OTB uses OPENMP
set(OTB_USE_OPENMP "@OTB_USE_OPENMP@")

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

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

# 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@")

# Default value for WINDOWS_EXPORT_ALL_SYMBOLS target property
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS "@OTB_CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS@")

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

set(OTB_APPLICATION_PATH "@OTB_CONFIG_APPLICATION_PATH@")

# 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@")

# Load application macros.
include(CMakeParseArguments)
include("@OTB_CONFIG_APPLI_MACROS_FILE@")

# 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})
