<div class="gmail_quote">After messing around with the issue, I have -almost- succeeded in accomplishing what I wanted. Right now, I&#39;m installing the top-level CMakeLists.txt file by setting:<br><br>set(CPACK_INSTALL_COMMANDS &quot;${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/CMakeLists.txt&nbsp; {CMAKE_BINARY_DIR}/_CPack_Packages/Linux-Source/TGZ/${CPACK_SOURCE_PACKAGE_FILE_NAME}&quot;)<br>
<br>Now two issues remain to be solved:<br>- I want the above command to be called only when building source packages, so is there a flag that I can use to wrap it in a if() clause? (something like CPACK_BUILD_SOURCE_PACKAGE or similar)<br>
<br>- There is one part of the destination path that is currently hardcoded, namely &quot;_CPack_Packages/Linux-Source/TGZ&quot;. Are there any CPack variables that contain this information?, especially the &quot;_CPack_Packages/Linux-Source&quot; part. I printed the values of all cmake variables and grepping for these strings and found nothing (except for my hardcoded lines :-P ).<br>
<br>In case this is relevant, I&#39;m using cmake 2.6.0, and these are the CPACK-related variables that I set before calling include(CPack):<br><br>set(CPACK_GENERATOR &quot;TGZ&quot;)<br>set(CPACK_SOURCE_GENERATOR &quot;TGZ&quot;)<br>
<br>set(CPACK_PACKAGE_DESCRIPTION_SUMMARY&nbsp; &quot;${PROJECT_NAME} project&quot;)<br>set(CPACK_PACKAGE_FILE_NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;${PROJECT_NAME}-${brief_VERSION}&quot;)<br>set(CPACK_SOURCE_PACKAGE_FILE_NAME&nbsp;&nbsp;&nbsp;&nbsp; &quot;${PROJECT_NAME}-source-${brief_VERSION}&quot;)<br>
set(CPACK_PACKAGE_INSTALL_DIRECTORY&nbsp;&nbsp;&nbsp; &quot;${PROJECT_NAME}-${brief_VERSION}&quot;)<br>set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY &quot;${PROJECT_NAME}-${brief_VERSION}&quot;)<br>set(CPACK_PACKAGE_NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;${PROJECT_NAME}&quot;)<br>
set(CPACK_PACKAGE_VENDOR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;XXXX&quot;)<br>set(CPACK_PACKAGE_VERSION&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;${${PROJECT_NAME}_VERSION}&quot;)<br>set(CPACK_PACKAGE_VERSION_MAJOR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;${${PROJECT_NAME}_VERSION_MAJOR}&quot;)<br>
set(CPACK_PACKAGE_VERSION_MINOR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;${${PROJECT_NAME}_VERSION_MINOR}&quot;)<br>set(CPACK_PACKAGE_VERSION_PATCH&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;${${PROJECT_NAME}_VERSION_PATCH}&quot;)<br><br># General setup<br>set(CPACK_PACKAGE_RELOCATABLE &quot;true&quot;)<br>
set(CPACK_SOURCE_INSTALLED_DIRECTORIES &quot;${CMAKE_SOURCE_DIR}/src;./src;${CMAKE_SOURCE_DIR}/etc;./etc;&quot;)<br>set(CPACK_SOURCE_IGNORE_FILES &quot;/CVS/;/\\\\.svn/;\\\\.swp$;~$;\\\\.\\\\#;/\\\\#&quot;)<br>set(CPACK_INSTALL_COMMANDS &quot;${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/CMakeLists.txt ${CMAKE_BINARY_DIR}/_CPack_Packages/Linux-Source/TGZ/${CPACK_SOURCE_PACKAGE_FILE_NAME}&quot;)<br>
<br>TIA,<br><br>Adolfo Rodríguez Tsouroukdissian<br><br>On Thu, Feb 5, 2009 at 5:08 PM, Adolfo Rodríguez <span dir="ltr">&lt;<a href="mailto:dofo79@gmail.com">dofo79@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br><br>I have a project with the following structure:<br><br>trunk<br>&nbsp; |-src<br>&nbsp; |-build_dir1<br>&nbsp; |-build_dir2<br>&nbsp; |-another_dir<br>&nbsp; |-CMakeLists.txt<br>&nbsp; |-unimportant_file<br>&nbsp; |-another_unimportant_file<br>
<br>
I am configuring CPack to make source packages. The content I&#39;m interested in packaging is folder src (and all its contents) and the shown CMakeLists.txt file, and ignore everything else.<br>I have successfully packaged src with<br>

<br>set(CPACK_SOURCE_INSTALLED_DIRECTORIES &quot;${CMAKE_SOURCE_DIR}/src;./src&quot;)<br><br>and now I would like to include the CMakeLists.txt file. Since the trunk folder is full of many things I do not wish to install, I&#39;d rather not use CPACK_SOURCE_IGNORE_FILES and specify a cunch of complex rules, but tell CPack to add an additional file. Is this possible?<br>

<br>I was trying out CPACK_INSTALL_COMMANDS, but I haven&#39;t figured out how to use it, and the variable is AFAIK pretty much undocumented (either in the book or online).<br><br>Any help would be much appreciated.<br><font color="#888888"><br>

Adolfo Rodríguez Tsouroukdissian<br>
</font></blockquote></div><br>