Hello Eric

> 2009/6/15 Jean-Pierre Bergamin <ja...@ractive.ch>:
> > Hello cmake users
> >
> > I want to put the current subversion revision into a script every time I
> run
> > "make install".
> > Currently, I use configure_file() to replace a variable in the script,
but
> > this only updates the script when either the script or something in
> > CMakeLists.txt changes.
> >
> > Is there a way to update the script every time I run "make install"?
> 
> Did you try with
> install([[SCRIPT <file>] [CODE <code>]] [...])
> 
> using this you may execute a CMake script at install time.

Good idea. This may lead to what I'm looking for. My svn_revision.cmake
script now looks like this:

find_package(Subversion)
if(Subversion_FOUND)
        Subversion_WC_INFO(${ER_SOURCE_DIR} ER)
        set(REVISION ${ER_WC_REVISION})
        configure_file(${ER_SOURCE_DIR}/scripts/version.sh.in
${ER_SOURCE_DIR}/scripts/version.sh @ONLY)
endif(Subversion_FOUND)

It is invoked in CMakeLists.txt with "install(SCRIPT svn_revision.cmake)".
The only problem I have now is that ${ER_SOURCE_DIR} is not defined in the
external script. Is there a way to pass arguments to this svn_revision.cmake
script?


Regards

James

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to