Re: [CMake] How to force package target generate a file before proceeding

2015-02-19 Thread Shyrokov, Sasha
, February 18, 2015 8:23 PM To: Shyrokov, Sasha Cc: cmake@cmake.org Subject: Re: [CMake] How to force package target generate a file before proceeding add_custom_command is rather used for operations performed during build phase (which is completely separate off packaging) You could create hgHash.txt

Re: [CMake] How to force package target generate a file before proceeding

2015-02-18 Thread Roman Bolshakov
add_custom_command is rather used for operations performed during build phase (which is completely separate off packaging) You could create hgHash.txt during packaging by using install(SCRIPT) command: install(SCRIPT hgHash.cmake) install(   FILES hgHash.txt   DESTINATION yourapp )

[CMake] How to force package target generate a file before proceeding

2015-02-17 Thread Shyrokov, Sasha
Hi, I would like to include a generated file into a package. I have something like that: include(CPack) add_custom_command (OUTPUT hgHash.txt COMMAND hg --debug id -i >hgHash.txt COMMENT "Getting hg hash") add_custom_target (hg_hash DEPENDS hgHash.txt COMMENT "hg_hash target")