diff --git a/cmake/GtsamBuildTypes.cmake b/cmake/GtsamBuildTypes.cmake index 0d249ad44..8c86c6f3d 100644 --- a/cmake/GtsamBuildTypes.cmake +++ b/cmake/GtsamBuildTypes.cmake @@ -156,20 +156,9 @@ mark_as_advanced(GTSAM_COMPILE_OPTIONS_PRIVATE_PROFILING) mark_as_advanced(GTSAM_COMPILE_OPTIONS_PRIVATE_TIMING) # Enable C++17: -if (NOT CMAKE_VERSION VERSION_LESS 3.8) - set(GTSAM_COMPILE_FEATURES_PUBLIC "cxx_std_17" CACHE STRING "CMake compile features property for all gtsam targets.") - # See: https://cmake.org/cmake/help/latest/prop_tgt/CXX_EXTENSIONS.html - set(CMAKE_CXX_EXTENSIONS OFF) - if (MSVC) - # NOTE(jlblanco): seems to be required in addition to the cxx_std_17 above? - list_append_cache(GTSAM_COMPILE_OPTIONS_PUBLIC /std:c++17) - endif() -else() - # Old cmake versions: - if (NOT MSVC) - list_append_cache(GTSAM_COMPILE_OPTIONS_PUBLIC $<$:-std=c++17>) - endif() -endif() +set(GTSAM_COMPILE_FEATURES_PUBLIC "cxx_std_17" CACHE STRING "CMake compile features property for all gtsam targets.") +# See: https://cmake.org/cmake/help/latest/prop_tgt/CXX_EXTENSIONS.html +set(CMAKE_CXX_EXTENSIONS OFF) # Merge all user-defined flags into the variables that are to be actually used by CMake: foreach(build_type "common" ${GTSAM_CMAKE_CONFIGURATION_TYPES})