CMAKE_PREFIX_PATH doesn't help CMake in finding Qt5
问题 From here: https://stackoverflow.com/a/28327499/462608 I tried this: cmake_minimum_required(VERSION 2.8.12) project(qtquick_hello_cmake) set(CMAKE_PREFIX_PATH "/opt/Qt5.9.1/5.9.1/") set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) find_package(Qt5 COMPONENTS Quick Core REQUIRED) qt5_add_resources(RESOURCES qml.qrc) add_executable(${PROJECT_NAME} "main.cpp" "qml.qrc") qt5_use_modules(${PROJECT_NAME} Quick Core) target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5: