[CMake] INCLUDE_DIRECTORIES per project

Adrian Boeing aboeing at gmail.com
Thu Apr 9 22:46:51 EDT 2009


Hi,

I would like to have a portable way of having separate include
directories for each 'project' in my visual studio 'solution'.
ie:
common/
dir/file1
dir/file2

share the include directory 'common' , and have seperate 'include1'
and 'include2' directories.
This would correspond to two 'projects' in my 'solution'
one with files1 and common,include1 directories
the other with files2 and common,include2 directories

It is my understanding that INCLUDE_DIRECTORIES is a global setting?

I think a few other people have asked about this for a while now:
http://www.cmake.org/pipermail/cmake/2005-November/007551.html

And it seems one answer has been suggested:
http://www.mail-archive.com/cmake@cmake.org/msg09372.html

"SET_SOURCE_FILES_PROPERTIES(source_file PROPERTIES
    COMPILE_FLAGS -I/include/path)"

But as the original poster wrote, it is not a portable solution.

Does the current version of CMake support a portable method of having
per-project include directories? How do I do this?

Thanks.
-Adrian


More information about the CMake mailing list