[CMake] Include Directories Cleanup/Remove Prior Entries

Alexander Neundorf a.neundorf-work at gmx.net
Wed Nov 10 12:15:45 EST 2010


On Wednesday 10 November 2010, Jeremy Torres wrote:
> I have a question regarding removing prior entries from
> include_directories.  Specifically, in a CMakeLists.txt, I have several
> targets.  For example:
>
> # target 1
> include_directories(x y z)
> add_executable(my_exe ...)
>
> #target 2
> include_directories(a b c)
> add_executable(my_exe2 ...)
>
> #target 3
> ....
>
> #target N
>
>
> I would like to be able to "cleanup" all includes for each target2 so that
> they ONLY include the target-specified includes.  I have looked through
> mailing lists, etc, and I only see the set_directory_properties(PROPERITES
> INCLUDE_DIRECTORES ""). I have tried this but it does not work.

If you need this, you have to put these targets into separate subdirectories.
The INCLUDE_DIRECTORIES are per directory, so this is AFAIK the only way to do 
it right now.

Alex


More information about the CMake mailing list