[CMake] Setting properties on all targets in one line

Eric Noulard eric.noulard at gmail.com
Thu May 31 17:05:49 EDT 2007


2007/5/31, Clinton Chau <clinton at clearcanvas.ca>:
> > > But I can't figure out a way of applying this prefix to all targets.
> >
> > You can also set EXECUTABLE_OUTPUT_PATH , which applies to all
> > executables "below" this point. Does this help ?
>
> Alex, thanks for replying. It's not ideal for us to use EXECUTABLE_ AND LIBRARY_OUTPUT_PATH, just because we want to preserve the conventional directory structure of outputs from a Visual Studio project. It also won't work for us because we'd like to keep debug and release versions of the binaries simultaneously (though in different output directories).

I think that if you want something specific for ALL your target
you may try to define YOUR own

MYPROJECT_ADD_LIBRARY
MYPROJECT_ADD_EXECUTABLE

macros
which wraps the genuine:
ADD_LIBRARY
ADD_EXECUTABLE

while systematically adding your extra:
SET_TARGET_PROPERTIES(<TARGET> PROPERTIES PREFIX "Win64/")

then you should use your specific macros.

Not that fun but it seems doable, but does it fits your needs?
-- 
Erk


More information about the CMake mailing list