[CMake] Propagating variable to toplevel parent

Bo Thorsen bo at askmonty.org
Wed Jul 7 07:07:03 EDT 2010

Den 07-07-2010 12:34, Mathieu Malaterre skrev:
> Hi there,
>    I am wondering if I am missing anything here. How would one
> propagate a variable across subdirectories in cmake ? I thought that a
> simple CACHE variable would do the trick, but using cmake 2.8.1 I had
> to do the following trick
> list(APPEND v "42")
> # make sure to actually update the CACHE variable:
> set(v ${v} CACHE INTERNAL "toto")
> My goal is that at the end of the toplevel cmakelists.txt file, cmake
> would have collected a list of installation path.


Bo Thorsen.
Monty Program AB.


MariaDB: MySQL replacement
Community developed. Feature enhanced. Backward compatible.

More information about the CMake mailing list