From 1d5d8f89d8b1b37d65aef220ea40593c10a4aa89 Mon Sep 17 00:00:00 2001 From: Gold856 <117957790+Gold856@users.noreply.github.com> Date: Tue, 7 Jan 2025 08:48:21 -0500 Subject: [PATCH] Clean up the enabling of C++17 MSVC flag is not needed and the minimum CMake version is higher now --- cmake/GtsamBuildTypes.cmake | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) 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})