[CMake] How to set CPACK_SOURCE_IGNORE_FILES to remove all source code?

David Fitzpatrick fitzpatrick at stellarscience.com
Mon Mar 9 15:09:04 EDT 2009


I have been working with CMake/CPack (2.6.2 and 2.6.3) for a few weeks 
now and have run into a problem with creating a binary distro using 
Cpack and NSIS. I would like to set a flag to remove all source code 
from the installer and have no success using the 
CPACK_SOURCE_IGNORE_FILES variable.

I have followed these examples:
http://www.mail-archive.com/cmake@cmake.org/msg02108.html
http://www.mail-archive.com/cmake@cmake.org/msg02143.html

I understand that the CPACK_SOURCE_IGNORE_FILES variable takes a list of 
regular expressions as defined here:
http://www.cmake.org/Wiki/CMake_FAQ#Which_regular_expressions_are_supported_by_cmake.3F

But I cannot seem to get the installer to not include source code...
I have tried many variants on this:
SET( CPACK_SOURCE_IGNORE_FILES
  ".*\\\\.cxx"
  ".*\\\\.cpp"
  ".*\\\\.h"
)

As well as just seeing if this variable works at all:
SET( CPACK_SOURCE_IGNORE_FILES ".*;.*\\\\..*" )

And I still get files included in the installer...

Is it possible that the install( directory ... ) command and the 
ignore_files variable do not work together?

This is a quick snippit of one of my install() commands that pulls 
directories:
  INSTALL( DIRECTORY 
"${STELLAR_SANDBOX}/${CPACK_COMPONENT_${componentToInstall}_LOCATION}"
    DESTINATION "${CPACK_COMPONENT_${componentToInstall}_LOCATION}/../"
    COMPONENT "DevSource"
    PATTERN ".svn" EXCLUDE )

I know I could glob the different types of source together set the 
component to "DevSource_h" or the likes and then just not add it to the 
install_list but that will be allot more work...




More information about the CMake mailing list