[cmake-developers] Need some pointers on learning the code
Clinton Stimpson
clinton at elemtech.com
Mon May 13 14:55:39 EDT 2013
On Monday, May 13, 2013 02:30:32 PM Brad King wrote:
> On 05/13/2013 02:07 PM, Robert Dailey wrote:
> > Actually now that I think about this a littler closer, changing the
> > generator expressions may not work for a specific case I'm blocked on.
> >
> > I store my third party library binaries in a "debug" and "release"
> > directories. I have a custom target that I define to copy the
> > appropriate debug or release DLLs to the appropriate output
> > directories, so that when I debug my applications, they find the
> > appropriate DLLs in the same directory. So the copy mapping should be
> > as follows:
> >
> > debug -> Debug
> > release -> Release
> > release -> RelWithDebInfo
> > release -> MinSizeRel
> >
> > Specifically for the RELEASE case. I can't use $<CONFIGURATION> for
> > the source directory, since the name is "release" between all 3
> > release configurations. This case is easily solved with issue 9974,
> > however. Any thoughts?
>
> This looks like the common use case I explain here:
>
> http://www.cmake.org/Bug/view.php?id=9974#c29033
>
> You don't need any new features for it.
To avoid the copy step, would it be useful to make generator expressions work
in target properties?
set_target_properties(mylib PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>/lib")
set_target_properties(myexe PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>/bin")
Currently, I can have more code than that to loop over
CMAKE_CONFIGURATION_TYPES and set those properties myself, and it results in
the libraries and executables being together without a copy step and without
an extra config directory separating them.
Clint
More information about the cmake-developers
mailing list