[prev in list] [next in list] [prev in thread] [next in thread]
List: cmake
Subject: Re: [CMake] CPack source packaging
From: Ian Monroe <ian.monroe () gmail ! com>
Date: 2013-03-07 18:36:23
Message-ID: 12181651.WKWMzDebib () togarashi
[Download RAW message or body]
On Wednesday, March 06, 2013 01:01:07 Szőts Ákos wrote:
> Dear list members,
>
> I made a project with CMake (2.8.10) on Linux and want to use CPack to
> create its source .tar.bz2 file.
>
> The task is really simple: copy all of the *.cpp and *.h files into the
> .tar.bz2 file preserving the directory structure.
What about the CMakeLists.txt? :)
> Although sounds really simple, I've yet to find a solution. The problems
> are: - In the source directory goes the development also, producing a lot
> of other files which are unneeded.
> - With CPACK_SOURCE_IGNORE_FILES variable I can exclude some files, but
> without the regexp positive lookahead feature I cannot say "exclude
> everything, except for the *.cpp and *.h"
> - Other solution would be an external command (eg. find and cp) to copy all
> the files into an other temporary directory and set that directory as the
> source directory. The drawback: there's no way to tell in CMakeLists.txt
> which is the current CPack generator, so I simply can't write "if
> (CPACK_GENERATOR STREQUAL "TBZ2")", because CPACK_GENERATOR is empty at
> "cmake ." time. So the find and copy command either ran all the time or not
> even once.
> - As a last resort I can execute a bz2 command which would do all the
> necessary things, but that would run every time (see the problem above).
>
> The command I issue to generate the source:
> cpack --config CPackSourceConfig.cmake
>
> Is there a simple solution to achieve this?
I think you should use your source code control system for this. It already
knows which files are source. Git has a git archive command for this
Ian
--
Powered by www.kitware.com
Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic