[CMake] How to package for Debian with Qt dependencies

Carlo Nicolini carlo.nicolini at iit.it
Tue Apr 10 07:01:23 EDT 2012


I've started a Qt project with CMake and until now is very successfull but
I'm wondering how to package my program for use with debian with the
correct dependencies

In the main CMakeLists.txt I have:

        set (CPACK_GENERATOR "DEB")
        set (${VERSION} CPACK_DEBIAN_PACKAGE_VERSION)
        set (CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
        set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS TRUE)
        set (CPACK_PACKAGE_FILE_NAME
"${CMAKE_PROJECT_NAME}_${FOOBARVERSION}_${LICENSE_TYPE}_${CPACK_DEBIAN_ARCHITECTURE}")
        SET(CPACK_PACKAGE_EXECUTABLES "FOOBAR" "FOOBAR
(v${FOOBAR_MAJOR}.${FOOBAR_MINOR}.${FOOBAR_PATCH})")

and in the CMakeLists.txt related to the executable itself

if (UNIX AND NOT APPLE)
add_executable(Foobar ${ALL_THE_NEEDED_FILES} )
target_link_libraries(Foobar ${QT_LIBRARIES} Common GL GLU glut)

INSTALL(TARGETS Foobar DESTINATION Foobar)
endif (UNIX AND NOT APPLE)

The debian package is created correctly but once in a clean test virtual
machine, I try to run it, the dpkg installer complains saying that *
freeglut3* dependencies are not satisfiable*.*
*Dependency is not satisfiable: freeglut3*

This is what I get after a dpkg --info

Package: FooBar
 Version: 0.1.1
 Section: devel
 Priority: optional
 Architecture: i386
 Depends: freeglut3, libc6 (>= 2.3.6-6~), libc6 (>= 2.4), libgcc1 (>=
1:4.1.1), libgl1-mesa-glx | libgl1, libglu1-mesa | libglu1, libgomp1 (>=
4.2.1), libqt4-opengl (>= 4:4.5.3), libqtcore4 (>= 4:4.6.1), libqtgui4 (>=
4:4.5.3), libstdc++6 (>= 4.4.0)


I've found somewhere the cpack_add_component command, is this somewhat
related to the missing dependencies?

Some hints?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120410/6ddec4ff/attachment-0001.htm>


More information about the CMake mailing list