ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/create_version.cmake
Revision: 1.1
Committed: Wed Oct 26 16:48:01 2011 UTC (12 years, 6 months ago) by greg
Branch: MAIN
Log Message:
Final tweaks to cmake cross-platform build system

File Contents

# Content
1 #${CMAKE_COMMAND} -DVERSION_OUT_FILE=v -DVERSION_IN_FILE=src/rt/VERSION -P src/common/create_version.cmake
2 find_program(DATE date)
3 if(DATE)
4 execute_process(COMMAND ${DATE} OUTPUT_VARIABLE DATE_STR)
5 string(STRIP "${DATE_STR}" DATE_STR)
6 endif()
7 find_program(WHO whoami)
8 if(WHO)
9 execute_process(COMMAND ${WHO} OUTPUT_VARIABLE WHO_STR)
10 string(STRIP "${WHO_STR}" WHO_STR)
11 endif()
12 find_program(HOSTNAME hostname)
13 if(HOSTNAME)
14 execute_process(COMMAND ${HOSTNAME} OUTPUT_VARIABLE HOST_STR)
15 message("DATE= ${DATE_STR}")
16 string(STRIP "${HOST_STR}" HOST_STR)
17 endif()
18 file(READ "${VERSION_IN_FILE}" VERSION)
19 string(STRIP "${VERSION}" VERSION)
20 message("${VERSION}")
21 file(WRITE "${VERSION_OUT_FILE}"
22 "char VersionID[]=\"${VERSION} lastmod ${DATE_STR}"
23 " by ${WHO_STR} on ${HOST_STR}\";\n"
24 )
25
26 # todo actually get the date, user name and hostname in this script