Skip to content

Fix configure error regarding find_package which cannot find qmsetup - #240

Merged
SineStriker merged 1 commit into
stdware:mainfrom
fragoulin:main
Aug 1, 2026
Merged

Fix configure error regarding find_package which cannot find qmsetup#240
SineStriker merged 1 commit into
stdware:mainfrom
fragoulin:main

Conversation

@fragoulin

Copy link
Copy Markdown
Contributor

When using a mxe toolchain, the following error appears:

CMake Error at build/win64/_deps/windowkit-src/CMakeLists.txt:133 (find_package):
  Could not find a package configuration file provided by "qmsetup" with any
  of the following names:

    qmsetupConfig.cmake
    qmsetup-config.cmake

  Add the installation prefix of "qmsetup" to CMAKE_PREFIX_PATH or set
  "qmsetup_DIR" to a directory containing one of the above files.  If
  "qmsetup" provides a separate development package or SDK, be sure it has
  been installed.

This fix simply sets the qmsetup_DIR variable before the call to find_package.

Related to #195

@wangwenx190
wangwenx190 requested a review from SineStriker July 25, 2026 03:18
@wangwenx190

Copy link
Copy Markdown
Collaborator

Thanks for your contribution! Sorry for the long delay due to we are quite busy recently.

@wangwenx190

Copy link
Copy Markdown
Collaborator

The issue is strange, can you provide a minimal reproduce example? How do you trigger this issue?

@fragoulin

fragoulin commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

Sorry for the lack of information.
This issue occurs with a MXE toolchain. I use it for easily cross-compiling my QT projects using the cmake integration.

You first have to install MXE and build required QT6 packages for x86_64-w64-mingw32.static target:

  1. Install MXE requirements
  2. Install MXE
    git clone https://github.com/mxe/mxe.git
  3. Build QT6 for x86_64-w64-mingw32.static target
cd mxe
make qt6-qtbase qt6-qtdeclarative -j 8 MXE_TARGETS='x86_64-w64-mingw32.static'
  1. Update path to MXE usr/bin directory
    export PATH=/where MXE is installed/usr/bin:$PATH

Then compile qwindowkit using cmake integration from MXE for x86_64-w64-mingw32.static target:

cd qwindowkit
x86_64-w64-mingw32.static-cmake -S . -B build_x86_64-w64-mingw32.static \
  -DCMAKE_PREFIX_PATH=<where-MXE-is-installed>/usr/x86_64-w64-mingw32.static/qt6 \
  -DCMAKE_INSTALL_PREFIX=/opt/qwindowkit_x86_64-w64-mingw32.static \
  -DQWINDOWKIT_BUILD_WIDGETS=ON \
  -DQWINDOWKIT_BUILD_QUICK=ON \
  -DWIN32=1

The error message appears during installation of qmsetup :

...
-- Installing qmsetup (Release)...
CMake Error at CMakeLists.txt:128 (find_package):
  Could not find a package configuration file provided by "qmsetup" with any
  of the following names:

    qmsetupConfig.cmake
    qmsetup-config.cmake

  Add the installation prefix of "qmsetup" to CMAKE_PREFIX_PATH or set
  "qmsetup_DIR" to a directory containing one of the above files.  If
  "qmsetup" provides a separate development package or SDK, be sure it has
  been installed.

@SineStriker

Copy link
Copy Markdown
Contributor

Thanks for your contribution. We did not take cross-compilation environment into consideration before.

@SineStriker
SineStriker merged commit ff54d13 into stdware:main Aug 1, 2026
SineStriker added a commit that referenced this pull request Aug 1, 2026
Cross compiling toolchains commonly set CMAKE_FIND_ROOT_PATH_MODE_PACKAGE to
ONLY, which re-roots every find_package search path into the target sysroot.
qmsetup provides tools that run on the build machine and is installed into the
build tree, so both lookups were redirected into the sysroot and failed right
after the package had been installed successfully.

Search for it on the build machine instead, and pass HOST to
qm_install_package so the toolchain does not leak into the nested build either.
NO_DEFAULT_PATH keeps the import bound to the copy that was just installed
rather than an unrelated one found through CMAKE_PREFIX_PATH.

Reported by fragoulin, who diagnosed the mxe case in #240.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants