LoveAndMercy
LoveAndMercy

Reputation: 47

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

I am 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
        )

Upvotes: 2

Views: 2461

Answers (0)

Related Questions