File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -132,17 +132,21 @@ endif()
132132delogohd_add_vapoursynth_compat_headers (delogohd_vapoursynth_headers )
133133
134134find_package (Git )
135+ set (GIT_REPO_VERSION "unknown-version" )
135136if (GIT_FOUND)
136137 execute_process (
137138 COMMAND ${GIT_EXECUTABLE} describe --first-parent --tags --always
138139 WORKING_DIRECTORY "${PROJECT_SOURCE_DIR } "
139140 OUTPUT_VARIABLE GIT_REPO_VERSION
141+ RESULT_VARIABLE GIT_REPO_VERSION_RESULT
142+ ERROR_QUIET
140143 OUTPUT_STRIP_TRAILING_WHITESPACE
141144 )
142- else ()
143- set (GIT_REPO_VERSION "unknown" )
145+ if (NOT GIT_REPO_VERSION_RESULT EQUAL 0 OR GIT_REPO_VERSION STREQUAL "" )
146+ set (GIT_REPO_VERSION "unknown-version" )
147+ endif ()
144148endif ()
145- string (REGEX REPLACE "^(r [0-9]+).*$" "\\ 1" VERSION "${GIT_REPO_VERSION} " )
149+ string (REGEX REPLACE "^(v [0-9]+( \\ .[0-9]+)* ).*$" "\\ 1" VERSION "${GIT_REPO_VERSION} " )
146150
147151set (DELOGOHD_GENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR } /generated" )
148152configure_file (
You can’t perform that action at this time.
0 commit comments