Clean up the enabling of C++17
MSVC flag is not needed and the minimum CMake version is higher nowrelease/4.3a0
							parent
							
								
									7742f025fc
								
							
						
					
					
						commit
						1d5d8f89d8
					
				|  | @ -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 $<$<COMPILE_LANGUAGE:CXX>:-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}) | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue