[CMake] How to CPack my sources

Eric Noulard eric.noulard at gmail.com
Thu Jul 19 12:01:54 EDT 2012


2012/7/19 Michael Jackson <mike.jackson at bluequartz.net>:
> I would like to be able to run "make source" or "cpack source" or something like that where just my source files are packed up.

You were almost there this is:

make package_source

>I have the following in a cmake file that is included in my Main CMakeLists.txt file:
>
>
> SET(CPACK_SOURCE_GENERATOR "TGZ")
> SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}_Source.tar.gz")
> SET(CPACK_SOURCE_TOPLEVEL_TAG "Source")
> SET(CPACK_IGNORE_FILES "/i386/;/x64/;/VS2008/;/zRel/;/Build/;/\\\\.git/;\\\\.*project")
> SET(CPACK_SOURCE_IGNORE_FILES "/i386/;/x64/;/VS2008/;/zRel/;/Build/;/\\\\.git/;\\\\.*project")
>
> I see that I get a CPackSourceConfig.cmake file in my build directory.
>
> I tried the following from the command line:
>
> cpack -G TGZ -C CPackSourceConfig.cmake

the appropriate syntax is:

cpack -G TGZ --config CPackSourceConfig.cmake

-C is the "Specify the project configuration" which
is "the configuration that the project was build with, for example
'Debug', 'Release'."

see:
http://www.cmake.org/cmake/help/v2.8.8/cpack.html#opt:-CConfiguration

> but that just created the usual binary release. I am sure I am missing something simple at this point.

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


More information about the CMake mailing list