Definite's Extractor

My findings on Life, Linux, Open Source, and so on.

Avoid packing junk with CPack (CMake)

CMake is a new generation build system. Compare to autotools (autoconf, automake):

Its advantage:

  • Extremely faster.
  • Cleaner output. (use make verbose=1 to yield compilation detail)
  • Fewer configuration file to be messed with

Of course, there is no free lunch, the CPack (software packer) is grossly stupid,
for it does not have a good default setting to exclude the redundant files,
such as backup files (~, .bak), CVS/SVN control files, previous tar-ed files,
even the files CMake generates.
In short, it packs every things and junk it finds.

CMake novices will find the size of their packages grow significantly,
as it includes the previous package recursively.

But don’t worry, there is always a way to avoid the situation.
Following example demonstrates how to avoid some usual “junk” files:

SET(COMMON_IGNORE_FILES '/CMakeFiles/' '/.svn/' '_CPack_Packages/' 
    '.cmake$' '~' '.swp' '.log' '.gz' '.directory$' 'CMakeCache.txt')

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: