Commit 8cab8279 authored by Guillaume Pasero's avatar Guillaume Pasero

BUG: fix c++11 requirement, check must be done after enablement/disablement routines

parent afa830a4
......@@ -169,6 +169,11 @@ 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,
......
......@@ -336,7 +336,5 @@ macro(otb_module_target _name)
endmacro()
macro(otb_module_requires_cxx11)
if(${otb-module}_ENABLED 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()
set(OTB_MODULE_${otb-module}_REQUIRES_CXX11 1)
endmacro()
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