From Fedora Project Wiki
(Avoid packing Junk with CPack (CMake))
 
(Removing all content from page)
 
Line 1: Line 1:
CPack is cross-platform software packaging tool distributed with CMake It uses the generators concept from CMake, to abstract package generation on specific platforms, and it can be used with or without CMake. Nevertheless, only the issues from CPack with CMake is discussed.


By default, CPack packs everything it found from the working directory. Unfortunately, this includes junks such as backup files ( *~ *.bak *.swp from vim), version control information (.svn/, CVS/). Novice package maintainers will even find out that the size of their packages increase dramatically, as it also packs the previous tarball.
In order to avoid packing junks, use following command to avoid the known file pattern.
<pre>
SET(COMMON_IGNORE_FILES "/CMakeFiles/" "_CPack_Packages/" "/Testing/"
    ".cmake$"  ".directory$" "CMakeCache.txt"
    "/.svn/"  "/CVS/" "~$" ".swp$" ".log$" ".gz$"
    "/src/config.h$")
SET(PRJ_COMMON_IGNORE_FILES ${COMMON_IGNORE_FILES}
  <PROJECT_SPECIFIC_IGNORE_FILES_PATTERN> )
SET(CPACK_SOURCE_IGNORE_FILES ${PRJ_COMMON_IGNORE_FILES}
  <PROJECT_SPECIFIC_IGNORE_FILES_PATTERN> )
SET(CPACK_PACKAGE_IGNORE_FILES ${PRJ_COMMON_IGNORE_FILES}
<FILES_PATTERN_THAT_YOU_DONT_WANT_TO_PUT_IN_BINARY_TARBALL> )
</pre>
Note that <code>COMMON_IGNORE_FILES</code> and  <code>PRJ_COMMON_IGNORE_FILES</code>
are not built-in CPack environment variables, use any name you wish.

Latest revision as of 07:09, 20 November 2008