title: CMake/CPack: How to avoid adding dependencies to devel packages
body: <p>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.</p>
  
  <p>The <code>_CPack_Packages/Linux/RPM/rpmbuild.out</code> file contain the following <code>Requires</code> section:</p>
  
  <pre><code>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)) 
  (…)
  </code></pre>
  
  <p>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.</p>
  
  <p>The CPack commands are:</p>
  
  <pre><code>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 &lt;Gael.de-Chalendar@cea.fr&gt;")
  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})
  </code></pre>
  
  <p>The code is available  <a href="https://github.com/aymara/lima/blob/master/CMakeLists.txt" rel="nofollow noreferrer">here</a>.</p>
  
  <p>How to avoid generating these spurious dependencies ?</p>
  
  <p>Note that this question is not a duplicate of "<a href="https://stackoverflow.com/questions/14658034/how-do-you-make-it-so-that-cpack-doesnt-add-required-libraries-to-an-rpm">How do you make it so that cpack doesn&#39;t add required libraries to an RPM?</a>" 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. </p>