From 5d36d49a3c5675b71975e432cc49155226013808 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Fri, 1 Mar 2024 15:06:03 +0000 Subject: [PATCH] use execute_process instead of exec_program --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cc95df43..8c66c77b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -133,7 +133,13 @@ set(SOURCES mtp/mtpz/TrustedApp.cpp ) -exec_program(git ARGS describe --tags --match='v*' OUTPUT_VARIABLE AFT_VERSION RETURN_VALUE GIT_STATUS) +find_package(Git) +execute_process(COMMAND ${GIT_EXECUTABLE} -C ${CMAKE_SOURCE_DIR} describe --tags --match=v\* + OUTPUT_VARIABLE AFT_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE GIT_STATUS + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) + if (GIT_STATUS EQUAL 0) string(REGEX MATCH "v([0-9a-fA-F.]+)-" _VERSION ${AFT_VERSION}) set(AFT_BASE_VERSION ${CMAKE_MATCH_1})