赞
踩
给一篇文章参考
https://blog.csdn.net/bank_dreamer/article/details/138678909
自己使用的范例
set(Qt5_DIR "/home/peak/Qt5.14.0/5.14.0/gcc_64/lib/cmake/Qt5") # 设置Qt5的安装目录 #set(CMAKE_PREFIX_PATH "/home/peak/Qt5.14.0") find_package(Qt5 COMPONENTS Widgets Network SerialPort SerialBus Sql Multimedia RemoteObjects Gui) MESSAGE("=================================================================") if(DEFINED Qt5_FOUND) MESSAGE(STATUS "find Qt5_FOUND: ${Qt5_FOUND}") MESSAGE(STATUS "Qt5Widgets_INCLUDE_DIRS: ${Qt5Widgets_INCLUDE_DIRS}") MESSAGE(STATUS "Qt5Multimedia_INCLUDE_DIRS: ${Qt5Multimedia_INCLUDE_DIRS}") MESSAGE(STATUS "Qt5MultimediaWidgets_INCLUDE_DIRS: ${Qt5MultimediaWidgets_INCLUDE_DIRS}") MESSAGE(STATUS "Qt5SerialPort_INCLUDE_DIRS: ${Qt5SerialPort_INCLUDE_DIRS}") MESSAGE(STATUS "Qt5Gui_INCLUDE_DIRS: ${Qt5Gui_INCLUDE_DIRS}") include_directories(${Qt5Widgets_INCLUDE_DIRS}) include_directories(${Qt5Multimedia_INCLUDE_DIRS}) include_directories(${Qt5Gui_INCLUDE_DIRS}) include_directories(/home/peak/Qt5.14.0/5.14.0/gcc_64/include/QtGui/5.14.0) include_directories(/home/peak/Qt5.14.0/5.14.0/gcc_64/include/QtCore/5.14.0) else() MESSAGE(STATUS "not find Qt5_FOUND: ${Qt5_FOUND}") endif() MESSAGE("=================================================================")
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。