Commit f804900b authored by Christophe Palmann's avatar Christophe Palmann

COMP:Check Cpp11 Keywords

parent 14eff0d0
include(CheckCXXSourceRuns)
unset(CMAKE_REQUIRED_INCLUDES) try_compile(OTB_IS_UNIQUE_PTR_DEFINED ${CMAKE_CURRENT_BINARY_DIR}/CMake ${CMAKE_SOURCE_DIR}/CMake/otbTestUniquePtr.cpp)
unset(CMAKE_REQUIRED_LIBRARIES) try_compile(OTB_IS_OVERRIDE_DEFINED ${CMAKE_CURRENT_BINARY_DIR}/CMake ${CMAKE_SOURCE_DIR}/CMake/otbTestUniquePtr.cpp)
set(CMAKE_REQUIRED_FLAGS ${CMAKE_CXX_FLAGS}) try_compile(OTB_IS_NULLPTR_DEFINED ${CMAKE_CURRENT_BINARY_DIR}/CMake ${CMAKE_SOURCE_DIR}/CMake/otbTestUniquePtr.cpp)
unset(CMAKE_REQUIRED_DEFINES)
# check if unique_ptr is defined
file(READ ${CMAKE_SOURCE_DIR}/CMake/otbTestUniquePtr.cpp
OTB_TEST_UNIQUE_PTR_SOURCE)
check_cxx_source_runs(
"${OTB_TEST_UNIQUE_PTR_SOURCE}"
OTB_IS_UNIQUE_PTR_DEFINED
)
# check if override keyword is known
file(READ ${CMAKE_SOURCE_DIR}/CMake/otbTestOverride.cpp
OTB_TEST_OVERRIDE_SOURCE)
check_cxx_source_runs(
"${OTB_TEST_OVERRIDE_SOURCE}"
OTB_IS_OVERRIDE_DEFINED
)
# check if nullptr keyword is known
file(READ ${CMAKE_SOURCE_DIR}/CMake/otbTestNullPtr.cpp
OTB_TEST_NULLPTR_SOURCE)
check_cxx_source_runs(
"${OTB_TEST_NULLPTR_SOURCE}"
OTB_IS_NULLPTR_DEFINED
)
unset(CMAKE_REQUIRED_FLAGS)
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