Bug 492753

Summary: KDE_INSTALL_DATAROOTDIR points to share on Windows
Product: [Frameworks and Libraries] extra-cmake-modules Reporter: Gena <genaloner>
Component: generalAssignee: ecm-bugs-null <ecm-bugs-null>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version: 6.5.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Gena 2024-09-07 14:35:13 UTC
SUMMARY

In KDEInstallDirs `DATAROOTDIR` points to `share` on Windows. But it should be `<BINDIR>/data`. This is where Qt will look on Windows (See `GenericDataLocation` in https://doc.qt.io/qt-6/qstandardpaths.html). Docs (https://api.kde.org/ecm/kde-module/KDEInstallDirs5.html) also say that `DATAROOTDIR` on Windows points to `<BINDIR>/data`.

The code also looks like it should also use `<BINDIR>/data`: https://invent.kde.org/frameworks/extra-cmake-modules/-/blob/master/kde-modules/KDEInstallDirsCommon.cmake#L271

But the `_define_relative` tries to take this variable from GNUInstallDirs module if `KDE_INSTALL_DIRS_NO_CMAKE_VARIABLES` is not set (by default):
https://invent.kde.org/frameworks/extra-cmake-modules/-/blob/master/kde-modules/KDEInstallDirsCommon.cmake#L93
But In GNUInstallDirs the `DATAROOTDIR` is defined as `share` which leads to the bug.

STEPS TO REPRODUCE
1. `include(KDEInstallDirs)`
2. `message(${KDE_INSTALL_DATAROOTDIR})

OBSERVED RESULT

Prints `share`.

EXPECTED RESULT

Prints `bin/data`.

SOFTWARE/OS VERSIONS
Windows: 10