User Tools

Site Tools


info:cmake

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
info:cmake [2011-05-10 18:13]
sam [CPack Notes]
info:cmake [2014-01-14 17:26] (current)
sam svn revision
Line 97: Line 97:
 cmake --help-module CPackRPM cmake --help-module CPackRPM
 </​code>​ </​code>​
 +
 +===== Build-Time SVN Revision =====
 +It's easy to use the ''​FindSubversion''​ module, but then the revision number doesn'​t get updated until you re-run CMake. There are a few different ways to get around this.
 +
 +Examples of creating a header containing the SVN version: http://​stackoverflow.com/​questions/​3780667/​use-cmake-to-get-build-time-svn-revision
 +
 +For setting CPack variables, you can set ''​CPACK_PROJECT_CONFIG_FILE''​ (something like ''​CMakeCPackOptions.cmake''​ or ''​CPackOptions.cmake''​),​ which gets run once each build for each generator, but there are some gotchas. In particular, you don't have access to ''​CMAKE_...''​ variables, so you may need to generate the CPack project config file from a "​.in"​ using ''​configure_file''​. See [[http://​cmake.3232098.n2.nabble.com/​Automatically-add-a-revision-number-to-the-CPack-installer-name-td7356239.html]].
info/cmake.txt · Last modified: 2014-01-14 17:26 by sam