[CMake] Exporting variables

Shishir Ramam sramam at gmail.com
Fri May 27 16:29:00 EDT 2005


Hi,

Consider the case when projects are nested as below
root/    # PROJECT(root)
     subproj1/..   # PROJECT(proj1)
     subproj2/..   # PROJECT(proj2)

Proj1 does some local checking to figure out variables local to subproj1. 
(For example version number and setting appropriate subdir settings).

In my case, I'd like this variable to be available to the parent
project "root" and
external project "proj2". Is there a way to export the variable value from 
proj1 such that it is visible outside proj1? 

I had initially set this up such that the detection and setting happens in 
the root project, so it's visible in a containing project as described above. 
This will allow each subproj to contain a complete Cmake specification. 

Hope this makes sense.

TIA,
-shishir



-- 
The man who doesn't read good books has no advantage over the man who
can't read them. - Mark Twain


More information about the CMake mailing list