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_...@\@project_n...@.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
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to