[CMake] CPack and configure_file

Eric Noulard eric.noulard at gmail.com
Wed Jan 12 17:55:24 EST 2011


2011/1/12 Tobias Ellinghaus <houz at gmx.de>:
> Am Tuesday 11 January 2011 schrub Eric Noulard:
>
> [...]
>
>> in fact I think the "real" source for this is the fact the CPack lacks
>> the notion
>> of "EXTRA" distribution file which is available with autoconf, EXTRA_DIST
>> var
>> http://www.gnu.org/software/hello/manual/automake/Basics-of-Distribution.h
>> tml or the dist-hook:
>> http://www.gnu.org/software/hello/manual/automake/The-dist-Hook.html#The-di
>> st-Hook
>>
>> The fact is CPack doesn't know much about "source package" and
>> in fact it package source using the CPACK_INSTALLED_DIRECTORIES directory
>> list. (look at the generated CPackSourceConfig.cmake)
>>
>> I think you can "emulate" the extra thing of autoconf.
>> If you want ot package "more" than the source tree with
>> "package_source" you can try
>> the following in your main CMakeLists.txt (before include(CPack))
>>
>> SET(CPACK_SOURCE_INSTALLED_DIRECTORIES
>> "${CMAKE_SOURCE_DIR};/;${CMAKE_BINARY_DIR}/extra;/extra")
>>
>> then the content of the directory
>> ${CMAKE_BINARY_DIR}/extra will added in the package source archive
>> inside "extra" dir.
>>
>> it should work.
>
> It does indeed work perfectly IFF I don't add CMAKE_BINARY_DIR to
> CPACK_SOURCE_IGNORE_FILES which is needed when someone creates a folder (let's
> say "build/") inside of the source dir and runs cmake from this folder which
> seems to be quite wide spread.
>
> Is it possible to have CPack somehow give more authority to
> CPACK_SOURCE_INSTALLED_DIRECTORIES than CPACK_SOURCE_IGNORE_FILES?

None that I am aware of.
You'll have to tweak your regex in CPACK_SOURCE_IGNORE_FILES... or...
write the file outside the build tree [ugly of the ugly]....

Like I said my proposal is a hack not a real feature :-(
A real feature for doing what you want is needed I think...


-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list