17 lines
594 B
CMake
17 lines
594 B
CMake
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()
|
|
|
|
# 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
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
|
|
# cmake-format: on
|
|
|
|
unset(output_file)
|