On Wed, Apr 22, 2009 at 10:03:53AM +0200, Marcel Loose wrote:
> Suppose that one of subA1's header files includes a header file from
> ext1. I can specify this in subA1 CMakeLists file by using
> include_directories(). However, subA2 will fail to compile when it
> includes this header file, because the compiler cannot find ext1's
> header file. More or less the same can be said about preprocessor
> variables; you would like to "inherit" the preprocessor variables from
> the project that you depend upon.

I don't know if it's best, but the way I handle this is by defining
${ext1_includes} and ${ext1_definitions} in a common place accessible to
both subA1 and subA2. I use a separate CMakeVars.txt for each project
that defines variables which a dependent might need to communicate with
that project. You could also use [set|get]_target_property.

Then subA1 and subA2 simply have ${ext1_includes} in their
include_directories() invocation.

tyler
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to