cmake Tutorial => C/C++ version selection
riptutorial.com › cmake › exampleWanted version for C and C++ can be specified globally using respectively variables CMAKE_C_STANDARD (accepted values are 98, 99 and 11) and CMAKE_CXX_STANDARD (accepted values are 98, 11 and 14): set (CMAKE_C_STANDARD 99) set (CMAKE_CXX_STANDARD 11) These will add the needed compile options on targets (e.g. -std=c++11 for gcc).
cmake - cppcheatsheet
cppcheatsheet.com › notes › cmake_basiccmake_minimum_required (VERSION 3.10) project (example) set (CMAKE_CXX_STANDARD 17) set (CMAKE_CXX_STANDARD_REQUIRED True) find_package (Boost) add_executable (a.out a.cpp) add_library (b STATIC b.cpp b.h) target_include_directories (a.out PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories (b PRIVATE "${Boost_INCLUDE_DIR ...