cmake configure时报错:
CMake Error at CMakeLists.txt:3 (find_package):
Found package configuration file:
/usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake
but it set Qt5_FOUND to FALSE so package "Qt5" is considered to be NOT
FOUND. Reason given by package:
The Qt5 package requires at least one component
按照提示:无论如何,正如错误告诉你的那样,Qt5包需要至少一个组件,你需要指定Qt5包的一个组件:
根据cmake文档说明,需要使用find_package(Qt5 REQUIRED COMPONENTS Widgets Core ...)接口,以便cmake(更好:Qt5 FindQt5.cmake的逻辑)知道要查找的内容。这将为您Qt5::Widgets
提供使用/链接的目标等。