[CMake] Setting properties on all targets in one line

Clinton Chau clinton at clearcanvas.ca
Fri Jun 1 15:20:03 EDT 2007


> > > > 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?

Eric, thanks for the tip. I think what will *really* fit my needs, is if the
Visual Studio 2005 Win64 generator allowed the setting of the
OutputDirectory XML element in the generated Visual Studio build files. That
would be perfect. For now, I will use these workaround approaches.

Thanks all!

Clinton Chau



More information about the CMake mailing list