Multiplatform frameworks

Jeremy Whiting jpwhiting at kde.org
Fri Feb 27 20:29:59 GMT 2015


Alex,

On Fri, Feb 27, 2015 at 4:05 AM, Alex Merry <alex.merry at kde.org> wrote:

> On Wednesday 25 February 2015 19:10:08 Jeremy Whiting wrote:
> > One issue I found however is that some frameworks (maybe all?) have a
> > KF5FooConfig.cmake.in with ${PACKAGE_PREFIX_PATH}/@KDE_INSTALL_DATADIR@
> in
> > them to specify where to find the data files. On my OS X install that was
> > getting filled in as "/usr/local/Users/jeremy/Library/Application
> Support"
> > which is incorrect. It seems on linux KDE_INSTALL_DATADIR is a subpath of
> > the prefix, but that doesn't work if we are installing data files outside
> > the prefix. So how should/could this be solved? I can think of three
> ideas:
> >
> > 1. Add another .cmake.in specifically for platforms that install data
> files
> > outside the prefix such as KF5FooMacConfig.cmake.in which is used on OS
> X
> > to generate the KF5FooConfig.cmake and doesn't include
> > ${PACKAGE_PREFIX_PATH}
>
> I'd rather avoid this approach - too easy to let the files get out of sync.
>
I agree.

>
> > 2. Inside KF5FooConfig.cmake.in have platform detection to define
> whether
> > to use the prefix or not.
>
> This is a lot of noise, and hard to check.
>
Agreed.

>
> > 3. Use absolute paths for KDE_INSTALL_DATADIR everywhere and remove
> > ${PACKAGE_PREFIX_PATH} completely.
>
> There is KDE_INSTALL_FULL_DATADIR, which is absolute. However, that removes
> the relocatability of the package that ${PACKAGE_PREFIX_PATH} provides. I'm
> not sure just how much we care about that.
>
How is that set, just at the command line with -DKDE_INSTALL_FULL_DATADIR
or I also saw some IS_RELATIVE in the code that set FULL_* if the path is
absolute, though I couldn't get that to trigger here somehow.

>
> 4. Use the PATH_VARS to ecm_configure_package_config_file().
>
> ecm_configure_package_config_file() behaves like
> configure_package_config_file from
> CMake 3.0, so see
> http://www.cmake.org/cmake/help/v3.1/module/CMakePackageConfigHelpers.html
>
> Basically, you add KDE_INSTALL_DATADIR to the PATH_VARS argument of
> ecm_configure_package_config_file(), and use @PACKAGE_KDE_INSTALL_DATADIR@
> in
> your Config.cmake.in file, and it should all work.
>

This sounds like the best option, could you throw together a patch to
kdoctools KF5KDocTools.ConfigCmake.cmake.in showing how that works? My
cmake foo is ok, but it would probably take me longer to do this than
someone that works with CMake every day.

>
> Alex
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20150227/9d139a99/attachment.htm>


More information about the kde-core-devel mailing list