Re: [CMake] Automatically add a revision number to the CPack installer name

2012-03-09 Thread Eric Noulard
2012/3/9 Glenn Ramsey g...@componic.co.nz: Thanks Eric, this lead me to a solution that works for me, where the revision number is updated at build time. For future reference here is what I did: [...] This is a nice and relatively easy solution. Thank you for sharing the final solution. --

[CMake] Automatically add a revision number to the CPack installer name

2012-03-08 Thread Glenn Ramsey
Is it possible to add, at build time, a revision number to the installer file name produced by CPack? I understand that to get the revision number at build time one must run a command and I have used that technique to generate a source code header, but I cannot figure out how to apply it to the

Re: [CMake] Automatically add a revision number to the CPack installer name

2012-03-08 Thread David Cole
On Thu, Mar 8, 2012 at 3:57 PM, Glenn Ramsey g...@componic.co.nz wrote: Is it possible to add, at build time, a revision number to the installer file name produced by CPack? I understand that to get the revision number at build time one must run a command and I have used that technique to

Re: [CMake] Automatically add a revision number to the CPack installer name

2012-03-08 Thread Michael Jackson
I do something like this in my CPack file: set(DREAM3D_VERSION_SHORT ${DREAM3DLib_VER_MAJOR}.${DREAM3DLib_VER_MINOR}) set(CPACK_PACKAGE_FILE_NAME DREAM3D-${DREAM3D_VERSION_SHORT}-${CMAKE_SYSTEM_NAME}) Where the DREAM3D_Lib_VER_* variables are generated with a call to my SCM (git in my case)

Re: [CMake] Automatically add a revision number to the CPack installer name

2012-03-08 Thread Glenn Ramsey
Hi Mike, When, during the build process is the call to the SCM made? If it is at build time, rather than cmake time, then how do you do it? Glenn On 09/03/12 10:15, Michael Jackson wrote: I do something like this in my CPack file: set(DREAM3D_VERSION_SHORT

Re: [CMake] Automatically add a revision number to the CPack installer name

2012-03-08 Thread Michael Jackson
The call is during CMake time. Which means you need to rerun cmake if your repository version runs. I guess you could try an add_custom_command(...) and run the SVN command to get the revision number and make it a prebuild step for one of your targets. Then it should get run at every build. --

Re: [CMake] Automatically add a revision number to the CPack installer name

2012-03-08 Thread Glenn Ramsey
Yes, you can use add_custom_command(...) to run a script to get the revision number, but I don't think you can use that to alter CPACK_PACKAGE_FILE_NAME, which has been set at cmake time. Glenn On 09/03/12 10:52, Michael Jackson wrote: The call is during CMake time. Which means you need to

Re: [CMake] Automatically add a revision number to the CPack installer name

2012-03-08 Thread Eric Noulard
2012/3/8 Glenn Ramsey g...@componic.co.nz: Yes, you can use add_custom_command(...) to run a script to get the revision number, but I don't think you can use that to alter CPACK_PACKAGE_FILE_NAME, which has been set at cmake time. This true but how wouldn't a revision update trigger a CMake

Re: [CMake] Automatically add a revision number to the CPack installer name

2012-03-08 Thread Glenn Ramsey
On 09/03/12 12:00, Eric Noulard wrote: 2012/3/8 Glenn Ramseyg...@componic.co.nz: Yes, you can use add_custom_command(...) to run a script to get the revision number, but I don't think you can use that to alter CPACK_PACKAGE_FILE_NAME, which has been set at cmake time. This true but how