Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Compiling on Mac M1 - cmake problem
Forum Updated to NodeBB v4.3 + New Features

Compiling on Mac M1 - cmake problem

Scheduled Pinned Locked Moved Unsolved Qt 6
4 Posts 2 Posters 2.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    maxwell31
    wrote on last edited by
    #1

    Hi,

    I am trying to port my application to Mac. I downloaded Qt 6.3.0 through the online installer. In may make file I have the following:

    set(Qt6_DIR /opt/Qt/6.3.0/macos/lib/cmake/Qt6)
    find_package(Qt6 REQUIRED Quick Core Gui Svg Qml Widgets QuickControls2 Test )
    
    

    When running cmake I get the following problems:

    CMake Warning at /opt/Qt/6.3.0/macos/lib/cmake/Qt6/Qt6Config.cmake:213 (find_package):
      Found package configuration file:
    
        /opt/Qt/6.3.0/macos/lib/cmake/Qt6Core/Qt6CoreConfig.cmake
    
      but it set Qt6Core_FOUND to FALSE so package "Qt6Core" is considered to be
      NOT FOUND.  Reason given by package:
    
      Target "Qt6::Core" was not found.
    
    Call Stack (most recent call first):
      extern/SortFilterProxyModel/CMakeLists.txt:5 (find_package)
    
    
    -- Could NOT find Qt6QmlTools (missing: Qt6QmlTools_DIR)
    CMake Warning at /opt/Qt/6.3.0/macos/lib/cmake/Qt6/Qt6Config.cmake:213 (find_package):
      Found package configuration file:
    
        /opt/Qt/6.3.0/macos/lib/cmake/Qt6Qml/Qt6QmlConfig.cmake
    
      but it set Qt6Qml_FOUND to FALSE so package "Qt6Qml" is considered to be
      NOT FOUND.  Reason given by package:
    
      Target "Qt6::Qml" was not found.
    
    Call Stack (most recent call first):
      extern/SortFilterProxyModel/CMakeLists.txt:5 (find_package)
    
    
    -- Could NOT find Qt6Core5Compat (missing: Qt6Core5Compat_DIR)
    CMake Error at extern/SortFilterProxyModel/CMakeLists.txt:5 (find_package):
      Found package configuration file:
    
        /opt/Qt/6.3.0/macos/lib/cmake/Qt6/Qt6Config.cmake
    
      but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT
      FOUND.  Reason given by package:
    
      Failed to find Qt component "Core".
    
      Expected Config file at
      "/opt/Qt/6.3.0/macos/lib/cmake/Qt6Core/Qt6CoreConfig.cmake" exists
    
      Failed to find Qt component "Qml".
    
      Expected Config file at
      "/opt/Qt/6.3.0/macos/lib/cmake/Qt6Qml/Qt6QmlConfig.cmake" exists
    
      Failed to find Qt component "Core5Compat".
    
      Expected Config file at
      "/opt/Qt/6.3.0/macos/lib/cmake/Qt6Core5Compat/Qt6Core5CompatConfig.cmake"
      does NOT exist
    
    
    

    What is going wrong?

    1 Reply Last reply
    0
    • kkoehneK Offline
      kkoehneK Offline
      kkoehne
      Moderators
      wrote on last edited by
      #2

      How did you pass the Qt installation to CMake?

      If you passed e.g. /opt/Qt/6.3.0/macos/lib/cmake/Qt6, try passing /opt/Qt/6.3.0/macos instead.

      Director R&D, The Qt Company

      1 Reply Last reply
      0
      • M Offline
        M Offline
        maxwell31
        wrote on last edited by
        #3

        This did not change anything.

        Regarding the last error message: The online installer allows to select Qt5 Compatibility module serperatly under 6.3.1. So under 6.3.1 this problem does not occur. However, the root of the problem seems to be

        CMake Warning at /opt/Qt/6.3.0/macos/lib/cmake/Qt6/Qt6Config.cmake:213 (find_package):
          Found package configuration file:
        
            /opt/Qt/6.3.0/macos/lib/cmake/Qt6Core/Qt6CoreConfig.cmake
        
          but it set Qt6Core_FOUND to FALSE so package "Qt6Core" is considered to be
          NOT FOUND.  Reason given by package:
        
          Target "Qt6::Core" was not found.
        

        This is what I don't understand. It means it found the right Qt6CoreConfig.cmake file, but because of "Target Qt6::Core was not found" it does not want to set it to true

        1 Reply Last reply
        0
        • kkoehneK Offline
          kkoehneK Offline
          kkoehne
          Moderators
          wrote on last edited by kkoehne
          #4

          This is what I don't understand. It means it found the right Qt6CoreConfig.cmake file, but because of "Target Qt6::Core was not found" it does not want to set it to true

          The exact logic Qt6 and Qt6Core interacts is a bit convoluted. You can see what exactly is going on with the --trace command. My best guess is that something goes wrong in Qt6CoreDependencies.cmake.

          Anyhow, the canonical way to set up Qt6 with CMake is not Qt6_DIR, but adding /opt/Qt/6.3.0/macos to CMAKE_PREFIX_PATH - either the environment variable, or the CMake cache variable. Does that fix your issue?

          Director R&D, The Qt Company

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved