Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-97097

Calling find_package Qt 5 before Qt 6 in CMakeLists.txt causes CMake Generate step failed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 6.2.0
    • Fix Version/s: None
    • Component/s: Build System: CMake
    • Labels:
      None
    • Environment:
      Windows 10 21H1 19043 / Arch Linux / Arch Linux ARM
      Qt 5.15.2 and 6.2.0 (Windows: official installer, Arch Linux: from pacman)
      Visual Studio 2019 16.11.3 / gcc 11.1.0
    • Platform/s:
      Linux/X11, Windows

      Description

      Use CMake to build the attached project and error occurs.
      This error does not occur if Qt6::Mulitmedia is removed from target_link_libraries in Test6Program.
      Occurs on both Windows and Linux (Arch Linux / Arch Linux ARM)

       

       D:\test>cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="D:\qqt\5.15.2\msvc2019_64;D:\qqt\6.2.0\msvc2019_64" .
       – The C compiler identification is MSVC 19.29.30133.0
       – The CXX compiler identification is MSVC 19.29.30133.0
       – Detecting C compiler ABI info
       – Detecting C compiler ABI info - done
       – Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
       – Detecting C compile features
       – Detecting C compile features - done
       – Detecting CXX compiler ABI info
       – Detecting CXX compiler ABI info - done
       – Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
       – Detecting CXX compile features
       – Detecting CXX compile features - done
       – Looking for pthread.h
       – Looking for pthread.h - not found
       – Found Threads: TRUE
       – Check if linker can resolve circular dependencies - TRUE
       – Performing Test HAVE_STDATOMIC
       – Performing Test HAVE_STDATOMIC - Success
       – Found WrapAtomic: TRUE
       – Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
       – Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR)
       – Could NOT find WrapOpenSSLHeaders (missing: OPENSSL_INCLUDE_DIR)
       – Configuring done
       CMake Error: The INTERFACE_QT_MAJOR_VERSION property of "Qt5::Core" does
       not agree with the value of QT_MAJOR_VERSION already determined
       for "Test6Program".
      
      – Generating done
       CMake Generate step failed. Build files cannot be regenerated correctly.
      
      D:\test>
      

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              qtbuildsystem Qt Build System Team
              Reporter:
              fsu0413 Frank Su
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes