configure_options.cmake 2.35 KB
Newer Older
Antoine Regimbeau's avatar
Antoine Regimbeau committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#
# Copyright (C) 2005-2019 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.
#

# This script is a prototype for the future CI, it may evolve rapidly in a near future
Stéphane Albert's avatar
Stéphane Albert committed
22
#This file set the following variable :
Antoine Regimbeau's avatar
Antoine Regimbeau committed
23 24 25 26 27
# * otb_build_project_option
# * otb_use_option
# * otb_wrap_option
# * CONFIGURE_OPTIONS

Stéphane Albert's avatar
Stéphane Albert committed
28
set (otb_build_project_option
29
"BUILD_COOKBOOK:BOOL=OFF
30
BUILD_EXAMPLES:BOOL=ON
31
BUILD_SHARED_LIBS:BOOL=ON
32
BUILD_TESTING:BOOL=ON")
Antoine Regimbeau's avatar
Antoine Regimbeau committed
33 34

set (otb_use_option
Antoine Regimbeau's avatar
Antoine Regimbeau committed
35 36 37 38 39 40
"OTB_USE_6S:BOOL=ON
OTB_USE_CURL:BOOL=ON
OTB_USE_GLEW:BOOL=ON
OTB_USE_GLFW:BOOL=ON
OTB_USE_GLUT:BOOL=ON
OTB_USE_GSL:BOOL=ON
41
OTB_USE_LIBKML:BOOL=OFF
Antoine Regimbeau's avatar
Antoine Regimbeau committed
42
OTB_USE_LIBSVM:BOOL=ON
Antoine Regimbeau's avatar
Antoine Regimbeau committed
43
OTB_USE_MPI:BOOL=OFF
Antoine Regimbeau's avatar
Antoine Regimbeau committed
44 45 46 47
OTB_USE_MUPARSER:BOOL=ON
OTB_USE_MUPARSERX:BOOL=ON
OTB_USE_OPENCV:BOOL=ON
OTB_USE_OPENGL:BOOL=ON
Antoine Regimbeau's avatar
Antoine Regimbeau committed
48
OTB_USE_OPENMP:BOOL=OFF
Antoine Regimbeau's avatar
Antoine Regimbeau committed
49 50
OTB_USE_QT:BOOL=ON
OTB_USE_QWT:BOOL=ON
51
OTB_USE_SHARK:BOOL=ON
Antoine Regimbeau's avatar
Antoine Regimbeau committed
52 53
OTB_USE_SIFTFAST:BOOL=ON
OTB_USE_SPTW:BOOL=ON
54 55
OTB_USE_SSE_FLAGS:BOOL=ON
OTB_MPIEXEC_OPT:STRING=--allow-run-as-root")
Antoine Regimbeau's avatar
Antoine Regimbeau committed
56 57

set (otb_wrap_option
Antoine Regimbeau's avatar
Antoine Regimbeau committed
58
"OTB_WRAP_JAVA:BOOL=ON
Guillaume Pasero's avatar
Guillaume Pasero committed
59
OTB_WRAP_PYTHON:BOOL=ON")
Antoine Regimbeau's avatar
Antoine Regimbeau committed
60 61

set (otb_data_option
62
"OTB_DATA_USE_LARGEINPUT:BOOL=OFF
Antoine Regimbeau's avatar
Antoine Regimbeau committed
63 64
OTB_DATA_LARGEINPUT_ROOT:PATH=${OTB_LARGEINPUT_ROOT}")

65 66
set (cmake_configure_option
"CMAKE_BUILD_TYPE=${CTEST_BUILD_CONFIGURATION}
67
CMAKE_INSTALL_PREFIX:PATH=${CTEST_INSTALL_DIRECTORY}")
68

69 70 71 72
if((CTEST_SITE) AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/${CTEST_SITE}.cmake")
  # will set its output in 'site_option'
  include("${CMAKE_CURRENT_LIST_DIR}/${CTEST_SITE}.cmake")
endif()
Antoine Regimbeau's avatar
Antoine Regimbeau committed
73

74 75 76 77 78 79 80 81
set(concat_options
"${otb_build_project_option}
${otb_use_option}
${otb_wrap_option}
${otb_data_option}
${cmake_configure_option}
${site_option}
")
Antoine Regimbeau's avatar
Antoine Regimbeau committed
82

83 84
#Transform the previous string in list
string (REPLACE "\n" ";" otb_options ${concat_options})
Antoine Regimbeau's avatar
Antoine Regimbeau committed
85

86 87 88
foreach(item ${otb_options})
  set( CONFIGURE_OPTIONS "${CONFIGURE_OPTIONS}-D${item};")
endforeach(item)