I\'m using VS 15.3, which supports integrated CMake 3.8. How can I target C++17 without writing flags for each specific compilers? My current global settings don\'t work:
You can keep that set(CMAKE_CXX_STANDARD 17) for other compilers, like Clang and GCC. But for Visual Studio, it's useless.
set(CMAKE_CXX_STANDARD 17)
If CMake still doesn't support this, you can do the following:
if(MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17") endif(MSVC)