<div class="gmail_quote">After messing around with the issue, I have -almost- succeeded in accomplishing what I wanted. Right now, I'm installing the top-level CMakeLists.txt file by setting:<br><br>set(CPACK_INSTALL_COMMANDS "${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/CMakeLists.txt {CMAKE_BINARY_DIR}/_CPack_Packages/Linux-Source/TGZ/${CPACK_SOURCE_PACKAGE_FILE_NAME}")<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 "_CPack_Packages/Linux-Source/TGZ". Are there any CPack variables that contain this information?, especially the "_CPack_Packages/Linux-Source" 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'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 "TGZ")<br>set(CPACK_SOURCE_GENERATOR "TGZ")<br>
<br>set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_NAME} project")<br>set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${brief_VERSION}")<br>set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-source-${brief_VERSION}")<br>
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}-${brief_VERSION}")<br>set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${PROJECT_NAME}-${brief_VERSION}")<br>set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")<br>
set(CPACK_PACKAGE_VENDOR "XXXX")<br>set(CPACK_PACKAGE_VERSION "${${PROJECT_NAME}_VERSION}")<br>set(CPACK_PACKAGE_VERSION_MAJOR "${${PROJECT_NAME}_VERSION_MAJOR}")<br>
set(CPACK_PACKAGE_VERSION_MINOR "${${PROJECT_NAME}_VERSION_MINOR}")<br>set(CPACK_PACKAGE_VERSION_PATCH "${${PROJECT_NAME}_VERSION_PATCH}")<br><br># General setup<br>set(CPACK_PACKAGE_RELOCATABLE "true")<br>
set(CPACK_SOURCE_INSTALLED_DIRECTORIES "${CMAKE_SOURCE_DIR}/src;./src;${CMAKE_SOURCE_DIR}/etc;./etc;")<br>set(CPACK_SOURCE_IGNORE_FILES "/CVS/;/\\\\.svn/;\\\\.swp$;~$;\\\\.\\\\#;/\\\\#")<br>set(CPACK_INSTALL_COMMANDS "${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/CMakeLists.txt ${CMAKE_BINARY_DIR}/_CPack_Packages/Linux-Source/TGZ/${CPACK_SOURCE_PACKAGE_FILE_NAME}")<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"><<a href="mailto:dofo79@gmail.com">dofo79@gmail.com</a>></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> |-src<br> |-build_dir1<br> |-build_dir2<br> |-another_dir<br> |-CMakeLists.txt<br> |-unimportant_file<br> |-another_unimportant_file<br>
<br>
I am configuring CPack to make source packages. The content I'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 "${CMAKE_SOURCE_DIR}/src;./src")<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'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'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>