[CMake] using cmake on windows - query on existing targets

John Drescher drescherjm at gmail.com
Wed Jan 6 14:57:15 EST 2010


I am going to only answer 1 part of this.

> For example: I may have a set of separate directories(each containing a
> project) and from the top level root directory, I want to selectively build
> a subset of projects.
>
> How can I do it on the command line ?

I do this with a batch file. Each project configures an install.bat.in
file which generates a install.bat in a Build sudirectory of the
projects Build tree.

Here is an example for a project called LungAnalysis

Here is the install.bat.in
[x:\]type X:\CMakeBased\Qt\LungAnalysis\install.bat.in
devenv @PROJECT_BINARY_DIR@\@PROJECT_NAME at .sln /build
@RELEASE_BUILD_NAME@ /project PACKAGE

Now the install.bat
[x:\]type X:\32Bit\VC.80\Qt\LungAnalysis\Batch\install.bat
devenv X:/32Bit/VC.80/Qt/LungAnalysis\LungAnalysis.sln /build
RelWithDebInfo /project PACKAGE

So then in a the root folder for the build trees for 32 bit vc2005
projects folder I have:

[x:\32bit\vc.80]type install_la.bat
call Lung\CT_Imaging\Batch\install.bat
call Lung\BZ_Airway\Batch\install.bat
call Lung\SCP_LS\Batch\install.bat
call Lung\JPU_Lobe\Batch\install.bat
call Qt\QtbasicUtils\Batch\install.bat
call Qt\LungAnalysis\Batch\install.bat

This builds all dependencies for the project by calling each projects
install.bat script.

I know this probably could be done in a more cross platform way but
this was pretty easy to implement on the platform I develop the most.
When I build on linux (not that often) I build each project manually.

John

John


More information about the CMake mailing list