我正在尝试在Ubuntu 18.04计算机中使用CMake交叉编译QT4应用程序。 以下是我在CMakeLists.txt中使用的相关行。
set(CMAKE_PREFIX_PATH "/opt/CrossPlatform/Qt-4.8.6/")
FIND_PACKAGE(Qt4 4.8.6 REQUIRED PATHS /opt/CrossPlatform/Qt-4.8.6/)
if(NOT Qt4_FOUND)
message(FATAL_ERROR "Package Qt4.8 not found")
endif()
SET(CMAKE_AUTOMOC ON)
INCLUDE(${QT_USE_FILE})
在运行cmake时,出现以下错误:
Could not find a package configuration file provided by "Qt4" (requested
version 4.8.6) with any of the following names:
Qt4Config.cmake
qt4-config.cmake
Add the installation prefix of "Qt4" to CMAKE_PREFIX_PATH or set "Qt4_DIR"
to a directory containing one of the above files. If "Qt4" provides a
separate development package or SDK, be sure it has been installed.
如何更正?