User:Dchen/CmakeCpack

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.

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}    )

SET(CPACK_SOURCE_IGNORE_FILES ${PRJ_COMMON_IGNORE_FILES}   )

SET(CPACK_PACKAGE_IGNORE_FILES ${PRJ_COMMON_IGNORE_FILES}  )

Note that  and are not built-in CPack environment variables, use any name you wish.