[CMake] Running shell scripts...
Benjamen R. Meyer
bm_witness at yahoo.com
Mon Feb 4 08:04:38 EST 2008
Brandon Van Every wrote:
> 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.
Ok, makes sense...but it still isn't showing up in the Makefile. Running
the following command in Bash still doesn't yield any results:
builddir $ for FILE in `find|grep Makefile`; do grep getSVNversion\.sh
${FILE}; done;
Ben
More information about the CMake
mailing list