Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix windows pipeline #183

Open
owlkward opened this issue Feb 15, 2024 · 1 comment
Open

fix windows pipeline #183

owlkward opened this issue Feb 15, 2024 · 1 comment
Labels

Comments

@owlkward
Copy link

Commit 2312fb2 tried to fix the windows pipeline, but cmake still does not find Qt for some reason.
Qt5 is installed via vcpkg and in the pipeline specifically with https://github.com/lukka/run-vcpkg/tree/v11.0, but the documentation from run-vcpkg says the dependencies are only built if the option runVcpkgInstall is set to true, but suggests it to not use that (and using it does not solve the problem, I have tried that).
Instead it suggests to let https://github.com/lukka/run-cmake/tree/v10 handle it, by using a preset set in CMakePreset.json that sets the CMAKE_TOOLCHAIN_FILE to the vcpkg.cmake contained in the vcpkg installation.
The vcpkg documentation claims that if vcpkg.cmake is used as the toolchain file the find_package calls should just work.
This is what is currently implemented, but it still fails.
Specifically the mentioned commit is heavily inspired by the samples linked in the run-cmake README, i.e. this workflow file https://github.com/lukka/CppBuildTasks-Validation/blob/v10/.github/workflows/hosted-ninja-vcpkg.yml and this CMakePreset.json for its ninja-multi-vcpkg preset: https://github.com/lukka/CppBuildTasks-Validation/blob/v10/cmakepresets/CMakePresets.json
This answer on a vcpkg issue microsoft/vcpkg#11247 (comment) says that it should work if the vcpkg triplet is explicitly set, but that also did not solve the problem, unless I did not set them correctly.

@owlkward owlkward added the bug label Feb 15, 2024
@owlkward
Copy link
Author

I also tried setting:
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/cmake/Qt5") set(Qt5_DIR "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/cmake/Qt5") set(CMAKE_PREFIX_PATH "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/cmake/Qt5") find_package(Qt5 COMPONENTS Core Widgets OpenGL Network REQUIRED)
but I still get the 'cannot find Qt5' error and that it wants a Qt5Config.cmake, but if make cmake print out the contents of Qt5_DIR with:
file(GLOB qt_dir "${Qt5_DIR}/*") message(FATAL_ERROR ${qt_dir})
(the FATAL_ERROR is just there so that it crashes at the message and I don't have to find the message within a million cmake prints)
I get this output:
"D:/a/grSim/grSim/out/build/ninja-multi-vcpkg/vcpkg_installed/x64-windows/share/cmake/Qt5/Qt5Config.cmakeD:/a/grSim/grSim/out/build/ninja-multi-vcpkg/vcpkg_installed/x64-windows/share/cmake/Qt5/Qt5ConfigVersion.cmakeD:/a/grSim/grSim/out/build/ninja-multi-vcpkg/vcpkg_installed/x64-windows/share/cmake/Qt5/Qt5ModuleLocation.cmake" which clearly contains "D:/a/grSim/grSim/out/build/ninja-multi-vcpkg/vcpkg_installed/x64-windows/share/cmake/Qt5/Qt5Config.cmake"

So whoever picks up this issue in the future: good luck, you're going to need it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant