[CMake] Running shell scripts...

Brandon Van Every bvanevery at gmail.com
Sun Feb 3 23:51:18 EST 2008


On Feb 3, 2008 7:16 PM, Benjamen R. Meyer <bm_witness at yahoo.com> wrote:
> I wrote a bash shell script to get the SVN global revision information
> (e-mail me privately if you want a copy) to put into a header file under
> POSIX systems. The script is located at ${CMAKE_ROOT}; however, I am
> having difficulty getting it to appear in the Makefile. Below is the
> syntax from top-most CMakeLists.txt:
>
> IF (WIN32)
>         # Execute Win32 Specific commands - none yet.
> ELSE (WIN32)
>         # Execute commands for other platforms
>         ADD_CUSTOM_COMMAND(
>                 OUTPUT SVN_REVISION
>                 COMMAND ${CMAKE_ROOT}/getSVNversion.sh
>                 WORKING_DIRECTORY ${CMAKE_ROOT}
>                 COMMENT "Creates/updates header SVN Revision Header"
>                 )
> ENDIF (WIN32)

OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/SVN_REVISION
Otherwise an out of source build fails.


Cheers,
Brandon Van Every


More information about the CMake mailing list