[CMake] More control with includes?

Brad King brad.king at kitware.com
Tue Jun 21 16:51:15 EDT 2005


Bradley Lowekamp wrote:
> I am needing more control over the include directories. Maybe I am 
> missing some part of CMake or some option some place. I have a directory 
> where I am trying to create a couple of libraries. But they have 
> conflicting include directory requirements. The "INCLUDE_DIRECTORIES" 
> command has no target or file specific effect, so that does not help me 
> with this problem.  I tried hacking around with the 
> "SET_DIRECTORY_PROPERTIES" with the "INCLUDE_DIRECTORIES", but the 
> effect of this command seems not to be immediate, and the result at the 
> end of the file is applies to all libraries in the directory.
> 
> Is there a way to get more control over include directories or an I 
> stuck with just INCLUDE_DIRECTORIES?

You'll have to use separate directories for the two libraries.  Using 
LIBRARY_OUTPUT_PATH you can get them to still show up next to each other 
in the build tree.  The source files can also stay next to one another 
because you can specify a relative path to them in the CMakeLists.txt file.

Per-target include directory (among other) settings would be a good 
feature request for the bug tracker if you want to add it:

http://www.cmake.org/Bug

-Brad


More information about the CMake mailing list