[CMake] Calling cmake from within cmake.

Josef Karthauser joe.karthauser at geomerics.com
Mon Oct 8 12:27:56 EDT 2007


> -----Original Message-----
> From: cmake-bounces+joe.karthauser=geomerics.com at cmake.org
> [mailto:cmake-bounces+joe.karthauser=geomerics.com at cmake.org] On
Behalf
> Of Josef Karthauser
> Sent: 08 October 2007 16:36
> To: cmake at cmake.org
> Subject: [CMake] Calling cmake from within cmake.
> 
> I want to recursively call cmake from a cmakelists.txt file to create
> build directories for other projects.  I'm sure I saw something in the
> docs that suggested a neat way of doing it that didn't involve
> executing
> cmake explicitly as an external command, but I can't find it now I
look
> again.  Can anyone tell me what it is off the top of their heads
> please?

In the mean time I'm doing,

    EXEC_PROGRAM(${CMAKE_COMMAND} ${CONFIG_SUBDIR}/${CONFIG}
        ARGS -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=${CONFIG}
-DBUILD_SUBTREE=1
        ${CMAKE_HOME_DIRECTORY}
    )

However that doesn't work because the double quotes aren't escaped.  How
do I escape quotes in cmake?

Joe



More information about the CMake mailing list