ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/create_version.cmake
Revision: 1.2
Committed: Fri Oct 28 20:46:47 2011 UTC (12 years, 6 months ago) by greg
Branch: MAIN
CVS Tags: rad4R2P2, rad5R0, rad5R1, rad4R2, rad4R1, rad4R2P1
Changes since 1.1: +8 -1 lines
Log Message:
Fixes to Version.c update in cmake build system

File Contents

# User Rev Content
1 greg 1.2 #${CMAKE_COMMAND} -DVERSION_OUT_FILE=v -DVERSION_IN_FILE=src/rt/VERSION -DVERSION_GOLD=src/rt/Version.c -P src/common/create_version.cmake
2    
3     # if the gold version exists then use that instead
4     if(EXISTS "${VERSION_GOLD}")
5     configure_file("${VERSION_GOLD}" "${VERSION_OUT_FILE}" COPYONLY)
6     return()
7     endif()
8    
9 greg 1.1 find_program(DATE date)
10     if(DATE)
11     execute_process(COMMAND ${DATE} OUTPUT_VARIABLE DATE_STR)
12     string(STRIP "${DATE_STR}" DATE_STR)
13     endif()
14     find_program(WHO whoami)
15     if(WHO)
16     execute_process(COMMAND ${WHO} OUTPUT_VARIABLE WHO_STR)
17     string(STRIP "${WHO_STR}" WHO_STR)
18     endif()
19     find_program(HOSTNAME hostname)
20     if(HOSTNAME)
21     execute_process(COMMAND ${HOSTNAME} OUTPUT_VARIABLE HOST_STR)
22     message("DATE= ${DATE_STR}")
23     string(STRIP "${HOST_STR}" HOST_STR)
24     endif()
25     file(READ "${VERSION_IN_FILE}" VERSION)
26     string(STRIP "${VERSION}" VERSION)
27     message("${VERSION}")
28     file(WRITE "${VERSION_OUT_FILE}"
29     "char VersionID[]=\"${VERSION} lastmod ${DATE_STR}"
30     " by ${WHO_STR} on ${HOST_STR}\";\n"
31     )
32    
33     # todo actually get the date, user name and hostname in this script