cmlib/CMLibGit.cmake

17 lines
594 B
CMake
Raw Permalink Normal View History

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
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
2021-06-17 12:48:21 +00:00
# cmake-format: on
unset(output_file)