[CMake] PROJECT_SOURCE_DIR needs two cMake pass to be set

Julien BIBOLLET julien.bibollet at gmail.com
Mon Jan 8 16:38:36 EST 2007


Hi,
I've simplified a problem I'm encountering:
I have following hierarchie:
|--proj1
|--|--CMakeLists.txt
|--CMakeLists.txt

the proj1/CMakeLists.txt contains:
PROJECT( PROJ1 )
SET( PROJ1_SRCS main.cc )
ADD_LIBRARY( PROJ1 STATIC ${PROJ1_SRCS} )

and the ./CMakeLists.txt contains:
SUBDIRS(proj1)
MESSAGE ( STATUS "PROJ1_SOURCE_DIR: ${PROJ1_SOURCE_DIR}")

now, when I run a cmake ., the PROJ1_SOURCE_DIR value is "", and if I then
rerun cmake . then the value is correct. Why does it need two cMake pass to
be correct, and is it possible to have it done in one ?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20070108/5b7c52bf/attachment.htm


More information about the CMake mailing list