Hello,

On 2/20/08, Robert Bielik <[EMAIL PROTECTED]> wrote:
> I have a structure where I include all subdirs via FILE(GLOB.. and FOREACH
> and within each subdir CMakeLists.txt I want to add a path to be used with
> INCLUDE_DIRECTORIES in the main CMakeLists.txt
>
> I tried SET(INCL_DIRS ${INCL_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/include) but 
> the
> INCL_DIRS variable is empty when I get "back" to the main CMakeLists.txt 
> file...
>
> How to?
To retrieve a variable from a subdirectory (added via
ADD_SUBDIRECTORY), you have to do something like:
GET_DIRECTORY_PROPERTY (MYVAR DIRECTORY subdirectory DEFINITION INCL_DIRS)
Have a look at cmake documentation for more info about GET_DIRECTORY_PROPERTY.

Regards,

> TIA
> /R
>
> _______________________________________________
> CMake mailing list
> CMake@cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>


-- 
Olivier DOLE
Software Engineer
_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to