当前位置:   article > 正文

ubuntu cmake使用自己版本的qt

ubuntu cmake使用自己版本的qt

给一篇文章参考
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("=================================================================")
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Guff_9hys/article/detail/911059
推荐阅读
相关标签
  

闽ICP备14008679号