Bug 484865 - Cross building KMyMoney5 with MinGW fails with alkimia 8.1.2
Summary: Cross building KMyMoney5 with MinGW fails with alkimia 8.1.2
Status: RESOLVED FIXED
Alias: None
Product: alkimia
Classification: Frameworks and Libraries
Component: General (show other bugs)
Version: 8.1.2
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-01 11:15 UTC by Ralf Habacker
Modified: 2024-04-01 11:18 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 8.1.3
Sentry Crash Report:


Attachments
log file (129.10 KB, text/plain)
2024-04-01 11:15 UTC, Ralf Habacker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Habacker 2024-04-01 11:15:48 UTC
Created attachment 168013 [details]
log file

SUMMARY
A cross build of kmymoney version 5.1.3 for Windows fails with alkimia 8.1.2.


STEPS TO REPRODUCE
1. see https://build.opensuse.org/package/live_build_log/windows:mingw:win64/mingw64-kmymoney5/openSUSE_Tumbleweed/x86_64

OBSERVED RESULT
Running cmake fails with: 

Search for dependency QtCore
[   25s] CMake Warning at /usr/share/cmake/Modules/CMakeFindDependencyMacro.cmake:76 (find_package):
[   25s]   By not providing "FindQtCore.cmake" in CMAKE_MODULE_PATH this project has
[   25s]   asked CMake to find a package configuration file provided by "QtCore", but
[   25s]   CMake did not find one.
[   25s] 
[   25s]   Could not find a package configuration file provided by "QtCore" with any
[   25s]   of the following names:
[   25s] 
[   25s]     QtCoreConfig.cmake
[   25s]     qtcore-config.cmake
[   25s] 
[   25s]   Add the installation prefix of "QtCore" to CMAKE_PREFIX_PATH or set
[   25s]   "QtCore_DIR" to a directory containing one of the above files.  If "QtCore"
[   25s]   provides a separate development package or SDK, be sure it has been
[   25s]   installed.
...
[   25s] CMake Error at CMakeLists.txt:136 (find_package):
[   25s]   Could not find a configuration file for package "LibAlkimia5" that is
[   25s]   compatible with requested version "7.0".
[   25s] 
[   25s]   The following configuration files were considered but not accepted:
[   25s] 
[   25s]     /usr/x86_64-w64-mingw32/sys-root/mingw/lib/cmake/LibAlkimia5-8.1/LibAlkimia5Config.cmake, version: 8.1.2
[   25s] 
[   25s] 
[   25s] 

EXPECTED RESULT
The build should not fail

SOFTWARE/OS VERSIONS
Linux: openSUSE Leap_15.5
KDE Frameworks Version: 5.76
Qt Version: 5.12
Comment 1 Ralf Habacker 2024-04-01 11:17:53 UTC
After an investigation, it turned out that the problem lies in the alkimia package, which generates a faulty LibAlkimia5Config.cmake
Comment 2 Ralf Habacker 2024-04-01 11:18:36 UTC
Git commit 1a46fe803fab966bb3ed2ef280ecca0f1f8b5ef0 by Ralf Habacker.
Committed on 01/04/2024 at 11:18.
Pushed by habacker into branch '8.1'.

cmake: Fix usage of Qt main version with Qt < 5.15

The error message on
https://build.opensuse.org/package/show/windows:mingw:win32/mingw32-kmymoney5
was 'Could not find a package configuration file provided by "QtCore"'.

According to
https://doc.qt.io/qt-6/cmake-qt5-and-qt6-compatibility.html#supporting-older-qt-5-versions
there is a variable QT_VERSION_MAJOR, not QT_MAJOR_VERSION, which is set
with a call to find_package(QT ...).
FIXED-IN:8.1.3

M  +4    -0    CMakeLists.txt
M  +1    -1    src/LibAlkimiaConfig.cmake.in

https://invent.kde.org/office/alkimia/-/commit/1a46fe803fab966bb3ed2ef280ecca0f1f8b5ef0