[cmake-developers] Generator expressions for install destination

Brad King brad.king at kitware.com
Thu Sep 10 11:06:38 EDT 2015


On 09/09/2015 12:21 PM, Robert Goulet wrote:
> Here’s the patch to add generator expressions to the install
> command DESTINATION option.

Thanks for the update.

>>This should not be needed if things are factored correctly.
>>Everything in that block already passes "config" through as a parameter.
> 
> None of the places where I use GetDestination, except in
> cmInstallTargetGenerator, receives a config in parameter.
> An ideally, the ConfigurationName member should not even exist,
> but that will force all places to pass the config as a parameter.
> Imho it’s better to keep refactoring in a separate patch.

I think such a separate refactoring patch should come first.
I cannot review the logic with confidence because I don't
know what implicitly depends on ConfigurationName being set
and whether call paths leading to it set it correctly.

Also, take a look at the install(EXPORT) case.  I tried using
a $<CONFIG> genex in the DESTINATION argument with your patch
but it fails trying to create a directory with literal $<CONFIG>
in its name (on Windows with a VS generator).  Note that the
install(EXPORT) command generates some files in the build tree
packed away under CMakeFiles/Export and then adds cmake_install.cmake
rules to install those.  Generation of these files needs to
expand the generator expression in time.

Thanks,
-Brad



More information about the cmake-developers mailing list