title: How to enable C++17 in CMake
body: <p>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:</p>
  <pre><code># https://cmake.org/cmake/help/latest/prop_tgt/CXX_STANDARD.html
  set(CMAKE_CXX_STANDARD 17)
  set(CMAKE_CXX_STANDARD_REQUIRED ON)
  set(CMAKE_CXX_EXTENSIONS OFF)
  
  # expected behaviour
  #set(CMAKE_CXX_FLAGS &quot;${CMAKE_CXX_FLAGS} /std:c++latest&quot;)
  </code></pre>
  <p>I expected CMake to add &quot;/std:c++lastest&quot; or equivalents when generating VS solution files, but no c++17 flags was found, resulted in compiler error:</p>
  <pre><code>C1189 #error: class template optional is only available with C++17.
  </code></pre>