Remove hard-coded C++ version checking from CMake and replaced with CXX_STANDARD CMake property

This commit is contained in:
Alexander Bock
2016-01-18 18:16:02 +01:00
parent 85d564767b
commit fc60692aeb

View File

@@ -106,23 +106,11 @@ function (set_compile_settings project)
${APP_SERVICES_LIBRARY}
)
elseif (UNIX)
include (CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
mark_as_advanced(COMPILER_SUPPORTS_CXX11, COMPILER_SUPPORTS_CXX0X)
if (COMPILER_SUPPORTS_CXX11)
target_compile_options(${project} PUBLIC "-std=c++11")
elseif (COMPILER_SUPPORTS_CXX0X)
target_compile_options(${project} PUBLIC "-std=c++0x")
else ()
message(FATAL_ERROR "Compiler does not have C++11 support")
endif ()
target_compile_options(${project} PUBLIC "-ggdb" "-Wall" "-Wno-long-long" "-pedantic" "-Wextra")
if (OPENSPACE_WARNINGS_AS_ERRORS)
target_compile_options(${project} PUBLIC "-Werror")
endif ()
target_compile_options(${project} PUBLIC "-ggdb" "-Wall" "-Wno-long-long" "-pedantic" "-Wextra")
endif ()
endfunction ()