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

Copy missing QML libraries from VCPKG buildenv on Windows and macOS #12267

Closed
JoergAtGithub opened this issue Nov 5, 2023 · 8 comments · Fixed by #12604
Closed

Copy missing QML libraries from VCPKG buildenv on Windows and macOS #12267

JoergAtGithub opened this issue Nov 5, 2023 · 8 comments · Fixed by #12604

Comments

@JoergAtGithub
Copy link
Member

Feature Description

I got the QML UI working on Windows, by using the buildenv from Main and copying the following files


.\mixxx-deps-2.5-x64-windows-32f6f03\installed\x64-windows\bin\Qt6LabsQmlModels.dll
.\mixxx-deps-2.5-x64-windows-32f6f03\installed\x64-windows\bin\Qt6QmlWorkerScript.dll
.\mixxx-deps-2.5-x64-windows-32f6f03\installed\x64-windows\bin\Qt6QuickControls2.dll
.\mixxx-deps-2.5-x64-windows-32f6f03\installed\x64-windows\bin\Qt6QuickControls2Impl.dll
.\mixxx-deps-2.5-x64-windows-32f6f03\installed\x64-windows\bin\Qt6QuickLayouts.dll
.\mixxx-deps-2.5-x64-windows-32f6f03\installed\x64-windows\bin\Qt6QuickShapes.dll
.\mixxx-deps-2.5-x64-windows-32f6f03\installed\x64-windows\bin\Qt6QuickTemplates2.dll
.\mixxx-deps-2.5-x64-windows-32f6f03\installed\x64-windows\bin\Qt6ShaderTools.dll

and directories

.\mixxx-deps-2.5-x64-windows-32f6f03\installed\x64-windows\Qt6\qml\Qt
.\mixxx-deps-2.5-x64-windows-32f6f03\installed\x64-windows\Qt6\qml\Qt5Compat
.\mixxx-deps-2.5-x64-windows-32f6f03\installed\x64-windows\Qt6\qml\QtQml
.\mixxx-deps-2.5-x64-windows-32f6f03\installed\x64-windows\Qt6\qml\QtQuick

to my build directory.

@Holzhaus
Copy link
Member

Holzhaus commented Nov 5, 2023

Are we sure that this isn't a bug in the vcpkg package? We should strive to fix this upstream in the portfile rather than adding this to our cmakelists file.

@daschuer
Copy link
Member

daschuer commented Nov 5, 2023

In Qt6, We need to copy the plugins ourself. This is a weakness but not a bug.

@acolombier
Copy link
Member

Note that this issue also appears to impact MacOS

@daschuer
Copy link
Member

daschuer commented Nov 6, 2023

We currently build Mixxx static on macOS. The Plugins are however loaded at runtime. In a static build they will be discarded. The vcpkg environment does not provide the dynamic builds.
Do you know how it supposed to work?
Do we need to move to dynamic linking on macOS like on windows? Unfortunately this was not working when I last tried it.

@daschuer daschuer added this to the 2.5.0 milestone Jan 8, 2024
@JoergAtGithub
Copy link
Member Author

daschuer:

The deployment of Qt6 has changed. I have tried to implement it but it fails and I give up for now since I am not a Windows developer. https://github.com/daschuer/mixxx/tree/qml6
Instead of fighting the Qt CMake macros that allow to selective install only used dependencies, we may just install the whole folder like it is done on Linux.

Can you point out which folder form the environment is required?

@JoergAtGithub
Copy link
Member Author

I could copy all the files above, by appending the following code to my CMakeLists.txt.
But something is missing again, mixxx --qml doesn't come up with these files.

# The following script must only be executed at install time
set(deploy_script "${CMAKE_CURRENT_BINARY_DIR}/deploy_Mixxx.cmake")

# Generate a deployment script to be executed at post build time
qt_generate_deploy_script(
    TARGET mixxx
    OUTPUT_SCRIPT deploy_script
    CONTENT "
include(\"${QT_DEPLOY_SUPPORT}\")
qt_deploy_qml_imports(
    # Deploy QML modules used by MyApp
    TARGET mixxx

    # The found QML plugins are stored in the plugins_found variable
    PLUGINS_FOUND plugins_found

    # The QML modules will be deployed into a custom directory
    QML_DIR \"qml\"
)
# Deploy application runtime dependencies and runtime dependencies
# of the found QML module plugins.
qt_deploy_runtime_dependencies(
    EXECUTABLE $<TARGET_FILE:mixxx>
    ADDITIONAL_MODULES \${plugins_found}
)
")

add_custom_command(
    TARGET mixxx POST_BUILD
    COMMAND "${CMAKE_COMMAND}" -DCOMPONENT=applocal -DCMAKE_INSTALL_PREFIX="${CMAKE_CURRENT_BINARY_DIR}" -P "${deploy_script}")

@daschuer
Copy link
Member

I was not able to use the deploy script successfully. So I added the files manually like it is done in the Linux packages.
#12604 should fix the issue.

@JoergAtGithub
Copy link
Member Author

#12604 copies only a few of the files listed above - and of cause Mixxx can't load the QML UI therefore

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

Successfully merging a pull request may close this issue.

4 participants