2021-06-17 12:44:08 +00:00
|
|
|
set(output_file ${CMAKE_BINARY_DIR}/include/cmlib_git_version.hpp)
|
|
|
|
if(CMLIB_GENERATED_HEADERS_PATH)
|
|
|
|
set(output_file ${CMLIB_GENERATED_HEADERS_PATH}/cmlib_git_version.hpp)
|
|
|
|
elseif(ARGV0)
|
|
|
|
set(output_file ${ARGV0})
|
|
|
|
endif()
|
|
|
|
|
2021-06-17 12:48:21 +00:00
|
|
|
# cmake-format: off
|
|
|
|
add_custom_target(git-version ALL
|
|
|
|
${CMAKE_COMMAND} -DCMLIB_PROJECT_NAME_UPPER=${CMLIB_PROJECT_NAME_UPPER}
|
|
|
|
-DCMLIB_MODULE_DIR=${CMLIB_MODULE_DIR}
|
|
|
|
-DCMLIB_GIT_VERSION_FILE=${output_file} -P ${CMLIB_MODULE_DIR}/CMLibGitVersion.cmake
|
2021-06-17 12:44:08 +00:00
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
|
2021-06-17 12:48:21 +00:00
|
|
|
# cmake-format: on
|
2021-06-17 12:44:08 +00:00
|
|
|
|
|
|
|
unset(output_file)
|