Commit 8ca2f075 authored by Manuel Grizonnet's avatar Manuel Grizonnet

ENH: Check of c++11 support and module declaration of c++11 requirements are...

ENH: Check of c++11 support and module declaration of c++11 requirements are not needed anymore in otb configuration
parent 852b55c4
......@@ -18,6 +18,9 @@
# limitations under the License.
#
# DEPRECATED: Not used in OTB cmake configuration
# DEPRECATED: should be removed after 6.2 release
include(CheckCXXSourceCompiles)
set(CMAKE_REQUIRED_FLAGS ${CMAKE_CXX_FLAGS})
......
......@@ -200,11 +200,6 @@ set(OTB_MODULES_ENABLED "")
set(OTB_MODULES_DISABLED "")
foreach(otb-module ${OTB_MODULES_ALL})
if(${otb-module}_ENABLED)
# check cxx11 requirement after all enable/disable macros have been passed
if(OTB_MODULE_${otb-module}_REQUIRES_CXX11 AND NOT OTB_HAS_CXX11)
message(FATAL_ERROR "Module ${otb-module} requires C++11 support. Consider adding -std=c++11 to your compiler flags or disabling it.")
endif()
list(APPEND OTB_MODULES_ENABLED ${otb-module})
# We will sort modules according to their dependency graph,
......
......@@ -359,5 +359,6 @@ macro(otb_module_target _name)
endmacro()
macro(otb_module_requires_cxx11)
message(WARNING "otb_module_requires_cxx11 is deprecated since OTB version 6.2 which build with c++14 by default. You can safely remove the call to this macro.")
set(OTB_MODULE_${otb-module}_REQUIRES_CXX11 1)
endmacro()
......@@ -231,9 +231,6 @@ set(CMAKE_EXE_LINKER_FLAGS "${OTB_REQUIRED_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}
set(CMAKE_SHARED_LINKER_FLAGS "${OTB_REQUIRED_LINK_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "${OTB_REQUIRED_LINK_FLAGS} ${CMAKE_MODULE_LINKER_FLAGS}")
# detect some C++11 keywords
include(OTBCheckCpp11Keywords)
# TODO BUILD_TESTING is created by default by CTest.cmake, and is ON by default.
option(BUILD_TESTING "Build the testing tree." OFF)
......@@ -336,12 +333,7 @@ if(OTB_WRAP_PYTHON)
set(OTB_CONFIG_CODE "${OTB_CONFIG_CODE}
set(OTB_PYTHONPATH \"${OTB_BINARY_DIR}/${OTB_INSTALL_PYTHON_DIR}\")")
endif()
if(OTB_HAS_CXX11)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(OTB_REQUIRED_CXX_FLAGS " -std=c++11")
endif()
endif()
set(OTB_CONFIG_APPLICATION_PATH "${OTB_BINARY_DIR}/${OTB_INSTALL_APP_DIR}")
set(OTB_CONFIG_TARGETS_CONDITION " AND NOT OTB_BINARY_DIR")
set(OTB_CONFIG_TARGETS_FILE "${OTB_BINARY_DIR}/OTBTargets.cmake")
......@@ -506,7 +498,6 @@ foreach(otb_option
CMAKE_BUILD_TYPE
CMAKE_C_FLAGS
CMAKE_CXX_FLAGS
OTB_HAS_CXX11
${option_list}
OTB_WRAP_PYTHON
OTB_WRAP_JAVA
......
......@@ -30,5 +30,3 @@ otb_module(OTBMuParserX
)
otb_module_activation_option("Enable MuParserX dependent modules" OFF)
otb_module_requires_cxx11()
......@@ -30,6 +30,3 @@ otb_module(OTBShark
)
otb_module_activation_option("Enable SHARK dependent modules" OFF)
otb_module_requires_cxx11()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment