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

Chauhan, Vikas vikas.chauhan at anritsu.com
Fri Jan 15 17:05:11 EST 2010


> 
> Remove this CMakeCache.txt file, and re-run and it should work.
> 
> I would start with a clean build tree and source tree.   If you have
> ever run cmake in-source, clean your source tree so that it has no
> generated stuff in it.   Also, remove the entire build tree, then you
> should be fine.

Great, it worked. Thanks for your help. 
Actually, I was generating the vc project & solution files, but someone
suggested that if I use nmake the I should be able to build targets
selectively from command window. Do you think it is possible?

My actual question is as below, please advise if it is possible ?

For example I have a main project/dir - projectSystem I have three
component/dirs - projectcomponent1, projectcomponent2,
projectcomponent3.

Now on windows command prompt from the directory where the cmake
generated files are present, at present I issue a  command : 
cmake --build PATH_TO_PROJECTSYSTEM
This builds the projectSystem alongwith projectComponent1,
projectComponent2 & projectComponent3.

Now, I want to do two things on windows command window:
1. Query the list of sub-targets(components) available. In this case the
result should be the following list:

projectComponent1
projectComponent2
projectComponent3

2. Now based on the list in 1, optionally build any component. For
example issue a command:

cmake --build projectComponent1

Can we achieve this? Or is it asking for too much :)



More information about the CMake mailing list