ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/create_version.cmake
Revision: 1.3
Committed: Mon Jan 8 16:51:32 2018 UTC (6 years, 5 months ago) by greg
Branch: MAIN
CVS Tags: rad5R2
Changes since 1.2: +6 -18 lines
Log Message:
Update to CMake build system from Rob G. and Alex S., adding test cases

File Contents

# User Rev Content
1 greg 1.3 #${CMAKE_COMMAND} -DRADIANCE_VERSION=v -DVERSION_OUT_FILE=v -DVERSION_IN_FILE=src/rt/VERSION -DVERSION_GOLD=src/rt/Version.c -P src/common/create_version.cmake
2 greg 1.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 greg 1.3 execute_process(COMMAND ${DATE} "+%F"
12     OUTPUT_VARIABLE DATE_STR
13     OUTPUT_STRIP_TRAILING_WHITESPACE
14     )
15 greg 1.1 endif()
16     file(READ "${VERSION_IN_FILE}" VERSION)
17     string(STRIP "${VERSION}" VERSION)
18     message("${VERSION}")
19     file(WRITE "${VERSION_OUT_FILE}"
20 greg 1.3 "char VersionID[]=\"RADIANCE ${RADIANCE_VERSION} NREL ${DATE_STR} (based on ${VERSION} Official Release by G. Ward)\";\n"
21 greg 1.1 )