blob: 9fcf3920f54f12f01313f11fdbac5079fec0c3fb [file] [log] [blame]
Brian Waters13d96012017-12-08 16:53:31 -06001# This file is called at build time. It regenerates the version.h file based on the hg version.
2
3EXECUTE_PROCESS(
4 COMMAND ${HGCOMMAND} id -i
5 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
6 RESULT_VARIABLE reshash
7 OUTPUT_VARIABLE verhash
8 ERROR_QUIET
9 OUTPUT_STRIP_TRAILING_WHITESPACE)
10EXECUTE_PROCESS(
11 COMMAND ${HGCOMMAND} id -n
12 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
13 RESULT_VARIABLE resval
14 OUTPUT_VARIABLE verval
15 ERROR_QUIET
16 OUTPUT_STRIP_TRAILING_WHITESPACE)
17
18if (reshash EQUAL 0)
19 SET(FD_PROJECT_VERSION_HG "${verval}(${verhash})")
20 message(STATUS "Source version: ${FD_PROJECT_VERSION_HG}")
21endif (reshash EQUAL 0)
22
23CONFIGURE_FILE(${SRC} ${DST})