<div><div><br></div><div>What is the preferred way of passing include directories globally to your cmake project from the command line? </div><div><br></div><div>I was looking at CMAKE_INCLUDE_PATH but noticed that it just helps it find files, it doesn&#39;t actually add the directories to the build. You have to do that via include_directories(). e.g. something like this might let you pass additional directories into your cmake project if you had this excerpt in your project&#39;s CMakeLists.txt:</div>
<div><br></div><div>foreach(path ${CMAKE_INCLUDE_PATH})</div><div><div>  include_directories(${path})</div><div>endforeach()</div></div><div><br></div><div>But this feels like I&#39;m bending it&#39;s original purpose to my iron will. Is there a reason why CMAKE_INCLUDE_PATH only does half the job?</div>
<div><br></div><div>If it&#39;s not the preferred way of passing include directories to a cmake project - is setting a CPATH environment variable the correct way? And isn&#39;t that awkward having to worry about both non-cmake and cmake variables to build your project?</div>
<div><br></div><div>I also wished to ask similarly re LIBRARY_DIRS vs CMAKE_LIBRARY_PATH as it is similar.<div></div></div><div><br></div>
</div>