[CMake] Delayed variable expansion?

Chris Green chissg at comcast.net
Wed Jul 20 16:15:51 EDT 2005


Hi,

I'm pretty much expecting to be told, "Can't get there from here", but I'd 
like to set a variable in a top-level project in terms of another variable 
which may change. I'd then like to refer to that variable at a lower level 
and have it expanded at the time of evaluation.

For example:

PROJECT ( TOP )
SET ( PROJ_README "${PROJECT_SOURCE_DIR}/README.txt"
CACHE "Where to find a project's README file"
   )
SUBDIRS ( BOTTOM )

Followed by:

PROJECT ( BOTTOM )
MESSAGE ( STATUS "PROJ_README = ${PROJ_README}" )

Is this even possible?

Thanks,
Chris.

-- 
Chris Green, MiniBooNE / LANL. Email greenc at fnal.gov
Tel: (630) 840-2167. Fax: (630) 840-3867


More information about the CMake mailing list