[cmake-developers] How to get install locations?

Tobias Hunger tobias.hunger at gmail.com
Thu Mar 23 11:37:46 EDT 2017

Hello CMake developers,

I got a bug assigned to me about missing information on install
locations in cmake server-mode. I wanted to fix that today, but so far
I failed to get that information. Does somebody have some hint?

What I tried is to just call
cmInstallTargetGenerator::GetInstallFilename which is static. That
works, but only gives me the filename. I need the full path.

cmInstallTargetGenerator has std::string GetDestination(std::string
const& config) const, too, which might have what I need. Unfortunately
that is not static, so I need to figure out how to get the right
instance of cmInstallTargetGenerator.

I tried to get the cmMakefile from the localGenerator and then iterate
over the list of cmInstallGenerator* I got from the cmMakefile's
GetInstallGenerators() method. But that in empty after I am done with
configure. Is that expected?

Am I on the right track with this?

One cmInstallTargetGenerator seems to install one file only and there
seems to be one per cmGeneratorTarget. Is that correct? How does the
installation of targets with multiple artifacts work?

Best Regards,

More information about the cmake-developers mailing list