Hi everyone,
I'm trying to configure CPack for packaging an executable and some shared libraries the application depends on. Both application and libraries are built by CMake. For NSIS, this works just fine, the installer includes all necessary files. However, the CPack Debian generator seems to only include the executable in the package, but not the shared libraries. Unfortunately, static linking is not an option due to licensing issues.

I've put some excerpts of the CMakeLists.txt files and CPack configuration below.

Some observations:
- Adding another executable target to the package works fine, only library targets are affected - Miscellaneous files installed with INSTALL(FILES ...) are properly included in the debian package
- "make install" installs the shared libraries, as it should
- As mentioned above, (almost) the same configuration works fine for the CPack NSIS generator - playing around with the DESTINATION arguments of the libraries' install commands didn't help

Am I missing something obvious? Doesn't the CPack .deb generator support packaging of pre-compiled libraries?

Thanks for any help,
Ben

###############################################################
# CMakeLists.txt and CPack configuration file in excerpts
###############################################################

# One of the  libraries
add_library(gdcp SHARED ${SOURCES} ${PUBLIC_HEADERS} ${PRIVATE_HEADERS} )

install(
    TARGETS gdcp
    LIBRARY DESTINATION lib
    RUNTIME DESTINATION bin
    COMPONENT gdcp_lib
)

# The executable
add_executable(gdcp_browser
    ${SOURCES}
    ${HEADERS}
)

install(
    TARGETS gdcp_browser
    RUNTIME DESTINATION bin
    COMPONENT gdcp_browser
)

And part of the CPack configuration file I use for the Debian package:

SET(CPACK_CMAKE_GENERATOR "Unix Makefiles")
SET(CPACK_GENERATOR "DEB")
SET(CPACK_INSTALL_CMAKE_PROJECTS
    "@CMAKE_BINARY_DIR@;gdcp;gdcp_browser;/"
    "@CMAKE_BINARY_DIR@;gdcp;gdcp_lib;/"
)
...
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to