[CMake] Setting properties on all targets in one line

Clinton Chau clinton at clearcanvas.ca
Thu May 31 14:29:41 EDT 2007


Doing a search on the mailing list didn't turn up what I was looking for
exactly, so I'm posting this question:

 

Is it possible to use SET_TARGET_PROPERTIES to set a property on *all*
targets, and not just the ones you specifically name.

 

Here's the motivation behind the question:

 

I want to build both x64 and Win32 binaries from the same source tree and
the same CMakeLists.txt, merely by choosing the appropriate generator,
Visual Studio 2005 or Visual Studio 2005 Win64, for example. I'd like all
the build output binaries in the Win64 case, to be stored under a "Win64" or
"x64" directory.

 

I can achieve this by modifying the CMakeLists.txt in each project
subdirectory and adding

 

SET_TARGET_PROPERTIES(<TARGET> PROPERTIES PREFIX "Win64/")

 

But I can't figure out a way of applying this prefix to all targets.

 

Any ideas?

 

Thanks in advance,

Clinton Chau

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20070531/072e7b04/attachment.htm


More information about the CMake mailing list