cmake find package can not see Qt6

84 views Asked by At

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)
    
0

There are 0 answers