configure_option.cmake 2.68 KB
Newer Older
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
22 23 24 25 26 27 28
#This file set the following variable : 
# * otb_build_project_option
# * otb_use_option
# * otb_wrap_option
# * CONFIGURE_OPTIONS

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

set (otb_use_option
Antoine Regimbeau's avatar
Antoine Regimbeau committed
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
"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
OTB_USE_LIBKML:BOOL=ON
OTB_USE_LIBSVM:BOOL=ON
OTB_USE_MPI:BOOL=ON
OTB_USE_MUPARSER:BOOL=ON
OTB_USE_MUPARSERX:BOOL=ON
OTB_USE_OPENCV:BOOL=ON
OTB_USE_OPENGL:BOOL=ON
OTB_USE_OPENMP:BOOL=ON
OTB_USE_QT:BOOL=ON
OTB_USE_QWT:BOOL=ON
51
OTB_USE_SHARK:BOOL=$ENV{OTB_USESHARK}
Antoine Regimbeau's avatar
Antoine Regimbeau committed
52 53 54
OTB_USE_SIFTFAST:BOOL=ON
OTB_USE_SPTW:BOOL=ON
OTB_USE_SSE_FLAGS:BOOL=ON")
55 56

set (otb_wrap_option
Antoine Regimbeau's avatar
Antoine Regimbeau committed
57 58 59
"OTB_WRAP_JAVA:BOOL=ON
OTB_WRAP_PYTHON:BOOL=ON
OTB_WRAP_PYTHON3:BOOL=ON")
60 61 62 63 64 65

set (otb_data_option
"OTB_DATA_ROOT:PATH=${OTB_DATA_ROOT}
OTB_DATA_USE_LARGEINPUT:BOOL=OFF
OTB_DATA_LARGEINPUT_ROOT:PATH=${OTB_LARGEINPUT_ROOT}")

66 67 68 69 70 71
set (cmake_configure_option
"CMAKE_BUILD_TYPE=${CTEST_BUILD_CONFIGURATION}
CMAKE_INSTALL_PREFIX:PATH=${CTEST_INSTALL_DIRECTORY}
CMAKE_C_FLAGS:STRING=-fPIC -Wall -Wextra
CMAKE_CXX_FLAGS:STRING=-fPIC -Wall -Wextra -Wno-cpp")

72 73 74 75
#Transform the previous string in list
string (REPLACE "\n" ";" otb_build_project_option ${otb_build_project_option})
string (REPLACE "\n" ";" otb_use_option ${otb_use_option})
string (REPLACE "\n" ";" otb_wrap_option ${otb_wrap_option})
76
string (REPLACE "\n" ";" otb_data_option ${otb_data_option})
77 78 79 80 81

set (otb_options "")
list (APPEND otb_options ${otb_build_project_option})
list (APPEND otb_options ${otb_use_option})
list (APPEND otb_options ${otb_wrap_option})
82
list (APPEND otb_options ${otb_data_option})
83 84 85

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

# This should be removed as soon as possible
set( CONFIGURE_OPTIONS "${CONFIGURE_OPTIONS}-Dopencv_INCLUDE_DIR:PATH=/usr/include;")