Skip to content

Commit

Permalink
use execute_process instead of exec_program
Browse files Browse the repository at this point in the history
  • Loading branch information
whoozle committed Mar 1, 2024
1 parent 028b134 commit 5d36d49
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down

0 comments on commit 5d36d49

Please sign in to comment.