title: Get all include folders from cmake executable
body: <p>How can I get all include directories of my executable? 
  I want to introduce cppcheck and I need to forward all include directories to cppcheck (also the include directories of the interface imported libraries).</p>
  
  <p>So for example I have</p>
  
  <pre><code>add_executable(my_exe main.cpp)
  target_link_libraries(my_exe PRIVATE RapidJSON::RapidJSON)
  </code></pre>
  
  <p>How can I get all corresponding include directories of my_exe, including the RapidJSON ones (e.g. ~/.conan/data/RapidJSON/1.1.0/a/b/package/x/include)?</p>
  
  <p>I tried following without success :-(</p>
  
  <pre><code>get_target_property(ALL_INCLUDES my_exe INTERFACE_INCLUDE_DIRECTORIES) # NOTFOUND
  get_target_property(ALL_INCLUDES my_exe INCLUDE_DIRECTORIES) # empty
  </code></pre>
  
  <pre><code>add_executable(my_exe main.cpp)
  target_link_libraries(my_exe PRIVATE RapidJSON::RapidJSON)
  
  # the following line should be adapted so that the variable cppcheck_includes also contains the RapidJSON include directories
  
  set(cppcheck_includes           ${CMAKE_SOURCE_DIR}/includes) 
  
  add_custom_target(cppcheck
          COMMAND cppcheck
          --enable=all
          --std=c++11
          --library=/usr/share/cppcheck/cfg/std.cfg
          --check-config
          ${cppcheck_includes}    
          main.cpp
  )
  
  </code></pre>
  
  <p>I expect that there is no warning, but there is a warning:</p>
  
  <pre><code>Include file: &lt;rapidjson/document.h&gt; not found.
  </code></pre>