[CMake] cpack -C CPackSourceConfig.cmake not making source package

Eric Noulard eric.noulard at gmail.com
Fri Sep 7 12:52:26 EDT 2012


2012/9/7 Jack Stalnaker <jack.stalnaker at gmail.com>:
> Even if I download the tutorial sources directly from cmake.org (for this
> tutorial  http://www.cmake.org/cmake/help/cmake_tutorial.html ), unzip them,
> and run cpack -C CPackSourceConfig.cmake, I don't get a source package.

-C is the wrong option.

You should do:

cpack --config CPackSourceConfig.cmake

> I get what I would consider a binary package. I saw that another user had
> reported the same issue here
> http://cmake.3232098.n2.nabble.com/How-to-deliver-a-source-code-package-td6505888.html
> but didn't really resolve it. That user resorted to make package_source,
> which does indeed pack up the source...and everything else in the directory.

This is the expected CPack "source" packaging behavior.
If you want to avoid that:

1) build out-of-source:
       http://www.cmake.org/Wiki/CMake_FAQ#Out-of-source_build_trees

2) setup appropriate value for CPACK_SOURCE_IGNORE_FILES

   see cpack --help-variable CPACK_SOURCE_IGNORE_FILES

> I tried throwing some dummy "sandbox" files in there, and they get zipped
> right up, too.  Am I doing something wrong? I'm following the tutorial as
> well as I can tell.  It seems like the command above should create a source
> package containing no binary files, and only the sources that you have told
> it to include.

CPack "source" packaging is currently packaging the source directory
while excluding "CPACK_SOURCE_IGNORE_FILES" that's unfortunately
a very basic behavior.

CPack cannot tel apart binary or source file unless you do out-of-source build.


-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org


More information about the CMake mailing list