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:
Your approach is the correct one, but it will not work for MSVC on versions of CMake prior to 3.10.
From the CMake 3.9 documentation:
For compilers that have no notion of a standard level, such as MSVC, this has no effect.
In short, CMake haven't been updated to accommodate for the standard flags added to VC++ 2017.
You have to detect if VC++ 2017 (or later) is used and add the corresponding flags yourself for now.
In CMake 3.10 (and later) this have been fixed for newer version of VC++. See the 3.10 documentation.