[CMake] CPack and configure_file

Tobias Ellinghaus houz at gmx.de
Mon Jan 10 18:55:20 EST 2011


Am Montag, 10. Januar 2011 schrub Eric Noulard:
> 2011/1/10 Tobias Ellinghaus <houz at gmx.de>:
> > Hello,
> > 
> > I create some files inside of CMAKE_CURRENT_BINARY_DIR using
> > configure_file(). These are not installed but needed for compiling the
> > program. When creating a .tgz file with make package_source these files
> > are not included so that the
> 
> package_source will include all file inside CMAKE_SOURCE_DIR
> so if you are doing out-of-source build the observed behavior is the
> expected one.
> 
> > resulting source package is basically useless.
> 
> WHY do you think so ?
> WHY you want to put GENERATED file inside your source .tgz?
> Do you expect your user to build from source without CMake?

No, reasons at the end of the mail.

> > Is there a way to add these files? I have searched through google and the
> > list archives and only found http://www.cmake.org/Bug/view.php?id=8438
> 
> I cannot see the relationship between your issue and the refered bug?

If I understood the issue in that bug correctly it would allow me to force 
cmake to copy/move the files into the source tree before packaging and remove 
them afterwards.

> > which would at least allow to copy the files into
> > CMAKE_CURRENT_SOURCE_DIR.
> 
> You may generate those file (with configure_file) inside your source tree
> and the generated file will be packaged by "package_source", but again
> WHY do you want to include a generated file inside your source package?

Because some information (like latest git commit as version string) is no 
longer available when using a source package. Of course I can put the 
generated files into the source tree, but that's kind of against the idea of 
out-of-source builds.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110111/b33c61e9/attachment.pgp>


More information about the CMake mailing list