diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d6be231f..c988a8003 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -420,23 +420,23 @@ if(NOT (CMAKE_VERSION VERSION_LESS "3.1")) else() if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") - add_compile_options(-std=c++11) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") else() - add_compile_options(-std=c++14) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") endif() endif() if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") if(OS_IS_MACOSX) if(CLANG_VERSION VERSION_LESS "600") - add_compile_options(-std=c++11) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") else() - add_compile_options(-std=c++14) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") endif() else() if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") - add_compile_options(-std=c++11) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") else() - add_compile_options(-std=c++14) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") endif() endif() endif()