CMake CPack debian packages

寵の児 提交于 2020-06-25 02:42:44

问题


Has someone worked with a working example of a CPack script for debian packages with Qt and OpenGL dependencies?

I've set this one

set (CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.3.1-6), libgcc1 (>= 1:3.4.2-12), libQtOpenGL (>=4.6.0), libQtCore (>=4.6.0), libQtGui (>=4.6.0), libglut (>=3.0), libICE (>=6.0), libX11 (>=6.0), libXext (>=6.0), libXmu (>=6.0), libXi (>=6.0), libstdc++ (>=6.0), libm (>=6.0), libgcc_s (>=1.0), libc (>=6.0), libGLU, libGL (>=1.0), libpthread" )

I googled around but never found a working example. My main problem is how to set the dependencies first for libGLU, then for libGL and the following libraries.

Once I've create the deb the installer says

 **Error: Dependency is not satisfiable: libXXX**

where XXX is one the libraries I listed before (mainly Qt libraries)

Currently my cmake version is 2.8.2 but cpack_add_component command doesn't work


回答1:


I don't think that you can "order" the dependencies in CMake. If you want a working example of a CMakeLists generating a .deb with qt dependencies look at :

project(QExhibitor)
cmake_minimum_required(VERSION 2.8)

FIND_PACKAGE(Qt4 REQUIRED QtNetwork QtGui QtCore QtXml)
FIND_PACKAGE(CSSRobopec REQUIRED)
#Some non interesting things ...
#.....
add_executable(QExhibitor ${QT_SOURCES} ${QT_RESOURCES_CPP} ${QT_FORMS_HPP} ${QT_MOC_HPP})
target_link_libraries(QExhibitor ${QT_LIBRARIES} ${CSSRobopec_LIBRARIES})

INSTALL(TARGETS QExhibitor DESTINATION /reetiPrograms/RApplications/Applications/)
INSTALL(FILES Icons/RQExhib.png DESTINATION /reetiPrograms/RApplications/Icons)

set(CPACK_GENERATOR "DEB")
set(CPACK_PACKAGE_VERSION_MAJOR "0")
set(CPACK_PACKAGE_VERSION_MINOR "2")
set(CPACK_PACKAGE_VERSION_PATCH "0")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "cssrobopec,libqt4-xml,libqt4-network,libqtgui4,treeupdatablereeti")
set(CPACK_PACKAGE_DESCRIPTION "Configure UExhibitor and launch missions")
set(CPACK_PACKAGE_CONTACT "Adrien BARRAL aba@robopec.com")
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/Debian/postinst")

include(CPack)



回答2:


You could use the CPACK_DEBIAN_PACKAGE_SHLIBDEPS CPack variable:

set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)

This will resolve dependencies automatically.



来源:https://stackoverflow.com/questions/10086615/cmake-cpack-debian-packages

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!