Skip to content

Draft: Make BUNDLE_INSTALL_DIR relative to EXECROOTDIR

Dawid Wrobel requested to merge work/BUNDLE_INSTALL_DIR_fix into master

BUG: 459214

This changes the default install directory from the absolute /Applications/KDE to a relative EXECROOTDIR/Applications/KDE.

The reasoning is explained in the BUG CC-ed, copied below:

When an add_executable() binary is cmake-installed on macOS, it ends up copied directly into /Applications/KDE. This is defined by KDEInstallDirs5 and follows the original assumption from 10 years ago, when KDEInstallDirs.cmake was crafted: 7289a551

Not only this ignores the -DCMAKE_INSTALL_PREFIX, but it also goes against the paradigm of macOS apps, where additional helper tools typically provided by add_executable() would be added inside the main app bundle itself — see https://developer.apple.com/documentation/bundleresources/placing_content_in_a_bundle for a reference.

In this context, a library (L) should not be installing its helper tool (T) bundle to /Application. Instead, any Application (A) which depends on library (L) should embed that library's tooling (T) bundles inside its (A's) own bundle.

What it means for the libraries is that bundles should be installed into regular /bin folder (but respecting CMAKE_INSTALL_PREFIX, if provided), while consuming Application's packaging tooling should copy the binaries accordingly — which, I believe, is the case for Craft.

Notably, this Diff doesn't change the installation to EXECROOTDIR/bin, but instead to EXECROOTDIR/Applications/KDE — contrary to what I suggested in the bug reported quoted above.

It most likely will have repercussions on Craft and bespoke packaging, if used, and therefore needs to be discussed first before merging.

Edited by Dawid Wrobel

Merge request reports