Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Could not find a configuration file for package "Qt6" that is compatible with requested version "".
QtWS25 Last Chance

Could not find a configuration file for package "Qt6" that is compatible with requested version "".

Scheduled Pinned Locked Moved Unsolved General and Desktop
cmakeqt6windowscmakelists.txt
3 Posts 2 Posters 8.6k Views
  • 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.
  • L Offline
    L Offline
    LoveAndMercy
    wrote on last edited by
    #1

    So im trying to configure my project via the Cmake GUI. Sadly CMake throws me this error:

     CMake Error at CMakeLists.txt:11 (find_package):
     Could not find a configuration file for package "Qt6" that is compatible
     with requested version "".
    
     The following configuration files were considered but not accepted:
    
       C:/Qt/6.3.1/mingw_64/lib/cmake/Qt6/Qt6Config.cmake, version: 6.3.1 (64bit)
    

    Any hints why this is happening? I already checked if maybe my config file does not exist in C:/Qt/6.3.1/mingw_64/lib/cmake/Qt6/Qt6Config.cmake but the file exists.

    Here is also my CMakeLists.txt:

    cmake_minimum_required(VERSION 3.22)
    project(environment_PO)
    
    set(CMAKE_CXX_STANDARD 14)
    set(CMAKE_AUTOMOC ON)
    set(CMAKE_AUTORCC ON)
    set(CMAKE_AUTOUIC ON)
    
    set (CMAKE_PREFIX_PATH "C:\Qt\6.3.1\mingw_64")
    
    find_package(Qt6 COMPONENTS
            Core
            Gui
            Widgets
            REQUIRED)
    
    add_executable(environment_PO main.cpp mainWindow.h mainWindow.cpp datetime.h datetime.cpp generateSubjectCode.h generateSubjectCode.cpp loadSettings.h loadSettings.cpp saveSettings.h saveSettings.cpp)
    target_link_libraries(environment_PO
            Qt6::Core
            Qt6::Gui
            Qt6::Widgets
            )
    
    
    
    1 Reply Last reply
    1
    • L Offline
      L Offline
      LoveAndMercy
      wrote on last edited by
      #2

      @LoveAndMercy said in Could not find a configuration file for package "Qt6" that is compatible with requested version "".:

      set (CMAKE_PREFIX_PATH "C:\Qt\6.3.1\mingw_64")

      Sorry i forgot to change my set path back, here the original version:

      set(CMAKE_PREFIX_PATH "C:/Qt/6.3.1/mingw_64")
      
      1 Reply Last reply
      0
      • X Offline
        X Offline
        xiaoyifang
        wrote on last edited by
        #3

        https://forum.qt.io/topic/121958/cmake-error-with-msvc-in-clion/7

        1 Reply Last reply
        0

        • Login

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