[CMake] Pass variables to sub directory CMakeLists.txt

Oliver Dole odole at sand-labs.org
Thu Feb 21 04:26:29 EST 2008


Hello,

On 2/21/08, Vandenbroucke Sander <Sander.Vandenbroucke at vandewiele.com> wrote:
> Hi,
>
>  I want to pass a variable to CMakeLists.txt's in sub directories:
>
>  Top directory CMakeLists.txt:
>  set( VAR1 "" )
>  add_subdirectory (subdir1)
>  add_subdirectory (subdir2)
>
>  Each subdir CMakeLists.txt:
>
>  ...
>  set( VAR1 "${VAR1} extend_var1" )
>  ...
>
>  I use VAR1 later on in the linker.
>
>  How can I make this work?
>
See this thread form yesterday for your answer ;)
http://www.cmake.org/pipermail/cmake/2008-February/019986.html

Regards,

>  Kind regards,
>  Sander.
>
>  _______________________________________________
>  CMake mailing list
>  CMake at cmake.org
>  http://www.cmake.org/mailman/listinfo/cmake
>


-- 
Olivier DOLE
Pleyo
Software Engineer


More information about the CMake mailing list