Skip to content

[BUG] Build with Qt6 seems to fail #219

@ConiKost

Description

@ConiKost

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingbuild-systemIssues related to the build (e.g. CMake)

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions