Debian Codegraph @

CMakeModules/GenerateBuildInfo.cmake

raw
1
2 set(BUILD_ID_DST_PATH "${PROJECT_BINARY_DIR}/src/Include/flightgearBuildId.h")
3
4 if (FG_BUILD_TYPE STREQUAL "Dev")
5 # default values for all of these
6 set(JENKINS_BUILD_ID "none")
7 set(JENKINS_BUILD_NUMBER 0)
8 set(REVISION "none")
9
10 # generate a placeholder buildId header
11 configure_file (${PROJECT_SOURCE_DIR}/src/Include/flightgearBuildId.h.cmake-in ${BUILD_ID_DST_PATH})
12
13 # dummy target, does nothing
14 add_custom_target(buildId)
15 else()
16 # for non-Dev builds, run this each time. using some CMake in script mode
17 # this takes a little bit of time since we have to actually run Git as a sub-process
18 add_custom_target(
19 buildId
20 ${CMAKE_COMMAND} -D SRC=${PROJECT_SOURCE_DIR}
21 -D DST=${BUILD_ID_DST_PATH}
22 -P ${PROJECT_SOURCE_DIR}/CMakeModules/buildId.cmake
23 )
24 endif()