0

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
        )
Tsyvarev
  • 60,011
  • 17
  • 110
  • 153
LoveAndMercy
  • 27
  • 1
  • 1
  • 6
  • "Any hints why this is happening?" - CMake already gives you a hint: `(64bit)`. You build your project for 32-bit platform, but attempt to use QT which is built for 64-bit platform. This doesn't work. – Tsyvarev Sep 06 '22 at 09:23
  • Can i change QT to an 32-bit platform? – LoveAndMercy Sep 06 '22 at 09:35
  • No, you cannot change platform for QT binaries. You need to download (or install) QT suitable for the platform, against which you want to build your project. – Tsyvarev Sep 06 '22 at 09:47

0 Answers0