Making writing Config.cmake files easier - updated example
Alexander Neundorf
neundorf at kde.org
Tue Jan 17 19:18:29 UTC 2012
On Tuesday 17 January 2012, Yury G. Kudryashov wrote:
> Alexander Neundorf wrote:
> > On Tuesday 17 January 2012, Yury G. Kudryashov wrote:
> >> I have to know the DESTINATION at generation time to hardcode correct
> >> relative paths.
> >
> > They can be calculated too, see the determine_installed_location() macro
> > in the branch ImprovedConfigDotCMakeFile in git in kdeexamples.
>
> determine_installed_location() needs to know @CMAKE_INSTALL_PREFIX@ and
> @CMAKECONFIG_INSTALL_DIR@,
Yes, it needs both, so it can determine the relative path from the
Config.cmake file to the install prefix.
At usage-time it then checks whether it is actually installed in that
location, and if not, "relocates" for now the relative install dirs.
> so we need to ensure (or document?) that the
> same directory used while writing MyLibConfig.cmake and installing it.
Hmm, I don't understand exactly what you mean, can you please explain a bit
more ?
Alex
More information about the Kde-buildsystem
mailing list