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

[BUG] Build with Qt6 seems to fail #219

Open
ConiKost opened this issue Jan 6, 2024 · 1 comment
Open

[BUG] Build with Qt6 seems to fail #219

ConiKost opened this issue Jan 6, 2024 · 1 comment
Assignees
Labels
bug Something isn't working build-system Issues related to the build (e.g. CMake)
Milestone

Comments

@ConiKost
Copy link

ConiKost commented Jan 6, 2024

Description
If -DPROJECTEUR_QT_VERSION=6 is being used, to build Projecteur with Qt6, it will fail, as it can't find the needed packages. This seems not be an issue with installed packages, but instead, the checks seems not correct.

Even, that -DPROJECTEUR_QT_VERSION=6 is set to Qt6, you can see, that ist still tries to get Qt5 additional.

    -- Detecting CXX compile features - done
    CMake Error at cmake/modules/Translation.cmake:1 (find_package):
      By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has
      asked CMake to find a package configuration file provided by "Qt5", but
      CMake did not find one.

Looking further, in modules/Translation.cmake is a check, which is hardcoded for Qt5 and gets also used, when trying to use Qt6.

find_package(Qt5 REQUIRED COMPONENTS Core)

As a result, more further errors happens:

    -- Found WrapVulkanHeaders: /usr/include
    CMake Error at /usr/lib64/cmake/Qt6Qml/Qt6QmlMacros.cmake:2415 (message):
       qt_generate_foreign_qml_types() is only available in Qt 6.

Looking into the code of Qt6QmlMacros clearly shows:

    if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
        if(QT_DEFAULT_MAJOR_VERSION EQUAL 6)
            function(qt_generate_foreign_qml_types)
                qt6_generate_foreign_qml_types(${ARGV})
            endfunction()
        else()
            message(FATAL_ERROR "qt_generate_foreign_qml_types() is only available in Qt 6.")
        endif()
    endif()

So apparently, the "bad" Qt5 check likely set QT_DEFAULT_MAJOR_VERSION to 5 despite trying to use Qt6.

To Reproduce

  • Install only Qt6 libs
  • Compile Projecteur with -DPROJECTEUR_QT_VERSION=6

Expected behavior
Compilation works with Qt6

Desktop/Linux Environment (please complete the following information):

  • Linux Distribution and Version: Gentoo Linux (Newest rolling release)
  • Desktop/Window Manager and Version: i3 4.23
  • Did you built Projecteur yourself?: Y
  • What is the output of projecteur -f ?: N/A
  • What is the output of projecteur -d ?: N/A
@jahnf
Copy link
Owner

jahnf commented Jan 8, 2024

@ConiKost thank you for reporting I will look into it.

@jahnf jahnf added bug Something isn't working build-system Issues related to the build (e.g. CMake) labels Jan 8, 2024
@jahnf jahnf added this to the v1.0 milestone Jan 8, 2024
@jahnf jahnf self-assigned this Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build-system Issues related to the build (e.g. CMake)
Projects
None yet
Development

No branches or pull requests

2 participants