Kleag
Kleag

Reputation: 650

CMake/CPack: How to avoid adding dependencies to devel packages

In my current setup (C++ project under Mageia 5 built using cmake), the cpack commands below cause the construction of RPM packages with dependencies to devel packages which is unnecessary.

The _CPack_Packages/Linux/RPM/rpmbuild.out file contain the following Requires section:

Requires: devel(libQt5Core(64bit)) devel(libQt5Test(64bit)) 
devel(libQt5Xml(64bit)) devel(libgcc_s(64bit)) 
devel(liblima-common-data(64bit)) devel(liblima-common-datahandler(64bit)) 
devel(liblima-common-factory(64bit)) devel(liblima-common-fsaaccess(64bit)) 
(…)

If found nowhere how this list was generated. If I manually run the find-requires script from RPM and other tools, I don't get devel packages.

The CPack commands are:

set(CPACK_PACKAGE_NAME "limacommon")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "LIMA Common libraries")
set(CPACK_PACKAGE_VENDOR "CEA LIST")
set(CPACK_PACKAGE_CONTACT "Gaël de Chalendar <[email protected]>")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
SET(CPACK_PACKAGE_VERSION_MAJOR "${LIMA_VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${LIMA_VERSION_MINOR}")
SET(CPACK_PACKAGE_VERSION_PATCH "${LIMA_VERSION_RELEASE}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "Lima-${LIMA_VERSION_MAJOR}.${LIMA_VERSION_MINOR}")
SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
SET(CPACK_NSIS_MODIFY_PATH "ON")
SET(CPACK_STRIP_FILES "bin/testDict16;bin/testLexicon")
SET(CPACK_SOURCE_STRIP_FILES "")
if ("x$ENV{LIMA_DISABLE_CPACK_DEBIAN_PACKAGE_SHLIBDEPS}" STREQUAL "x")
  set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
endif()
set(CPACK_GENERATOR ${SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR})

The code is available here.

How to avoid generating these spurious dependencies ?

Note that this question is not a duplicate of "How do you make it so that cpack doesn't add required libraries to an RPM?" because this question was about voluntarily disabling automatic dependency tracking while mine is about correcting a wrong behaviour while keeping the automatic dependency tracking. BTW, I already found this question and navigated through the links it contains.

Upvotes: 1

Views: 1260

Answers (0)

Related Questions