title: Target requires the language dialect "CXX17" (with compiler extensions), but CMake does not know the compile flags to use to enable it
body: <p>So I've been trying to include the <code>&lt;filesystem&gt;</code> into my project, which seem to be a bigger problem than I thought.  <code>&lt;filesystem&gt;</code> should be part of c++17, I need to add that definition into my CMakeList. </p>
  
  <p>My root CmakeLists look like this: </p>
  
  <pre><code>MESSAGE(“In src CMAKELIST”)
  
  #
  # Build everything in include/ directory
  add_subdirectory(include)
  #
  
  #set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
  #set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
  
  set(CMAKE_CXX_STANDARD 17)
  set(CMAKE_CXX_STANDARD_REQUIRED ON)
  
  ## Main executable target
  add_executable(cmakeDemo main.cpp)
  
  # These libraries get built in include/*/, CMake will auto-set required
  # compiler flags and include paths from their definitions
  target_link_libraries(cmakeDemo record ${portaudio})
  target_link_libraries(cmakeDemo database)
  target_link_libraries(cmakeDemo match)
  target_link_libraries(cmakeDemo spectogram)
  </code></pre>
  
  <p>In which I added the c++17 definition, but when I compile my system, I get this error:</p>
  
  <pre><code> make 
  “InsrcCMAKELIST”
  “InincludeCMAKELIST”
  “IndatabaseCMAKELIST”
  “InmatchCMAKELIST”
  “InrecordCMAKELIST”
  “InspectogramCMAKELIST”
  /home/lamda/soundcloud/src/include/spectogram/base/base.h
  “outspectogramCMAKELIST”
  -- Configuring done
  CMake Error in src/CMakeLists.txt:
    Target "cmakeDemo" requires the language dialect "CXX17" (with compiler
    extensions), but CMake does not know the compile flags to use to enable it.
  
  
  -- Generating done
  -- Build files have been written to: /home/lamda/soundcloud/build
  make: *** [cmake_check_build_system] Error 1
  </code></pre>
  
  <p>But somehow isn't it willing to use c++17, so I can use the <code>filesystem</code> library? why?</p>