0

I downloaded qt6 -> qtbase only and built, install it , i write simple program to check it, when I tried to locate Qt6 it show me this error :

  • CMake Error at CMakeLists.txt:13 (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:

  • F:/Work/ToolChain/qt5/install/lib/cmake/Qt6/Qt6Config.cmake, version: 6.0.4 (32bit)

  • Configuring incomplete, errors occurred!

    CMAKE_MINIMUM_REQUIRED(VERSION 3.20) project(QT_FP)

     set(CMAKE_CXX_STANDARD 17)
     set(CMAKE_CXX_STANDARD_REQUIRED True)
    
     list(APPEND CMAKE_PREFIX_PATH  "F:/Work/ToolChain/qt5/install/lib/cmake")
    
     find_package(Qt6 CONFIG REQUIRED COMPONENTES Core)
    
     set(CMAKE_AUTOMOC ON)
     set(CMAKE_AUTOUIC ON)
     set(CMAKE_AUTORCC ON)
    
     file(GLOB SRC ${PROJECT_SOURCE_DIR}/src/*.cpp)
     file(GLOB INC ${PROJECT_SOURCE_DIR}/include/*.hpp)
     file(GLOB UIS ${PROJECT_SOURCE_DIR}/include/*.ui)
    
     add_executable(${PROJECT_NAME})
     target_sources(${PROJECT_NAME} PUBLIC ${SRC} ${INC} ${UIS} )
     target_include_directories(${PROJECT_NAME} PUBLIC ${PROJECT_SOURCE_DIR}/include)
     target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core)
    
  • "F:/Work/ToolChain/qt5/install/lib/cmake" I see qt5 in this path ;) – Mizux May 01 '22 at 08:30
  • @Mizux Qt 6 repo is still named `qt5`. Anyway I see a typo in `COMPONENTES` it should be `COMPONENTS` and the `CONFIG` looks misplaced. And possibly you want `CMAKE_PREFIX_PATH` to point to `"F:/Work/ToolChain/qt5/install"`. But it is hard to give a definitive answer, it could be a corrupted Qt install. – Benjamin T May 03 '22 at 17:02

0 Answers0