diff options
Diffstat (limited to 'cmake/GitFunctions.cmake')
-rw-r--r-- | cmake/GitFunctions.cmake | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/cmake/GitFunctions.cmake b/cmake/GitFunctions.cmake index 898e7b01..a055b5de 100644 --- a/cmake/GitFunctions.cmake +++ b/cmake/GitFunctions.cmake @@ -9,29 +9,29 @@ include(CMakeParseArguments) if(GIT_FOUND) function(git_run) - set(oneValueArgs OUTPUT_VAR DEFAULT) - set(multiValueArgs COMMAND) - cmake_parse_arguments(GIT_RUN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + set(oneValueArgs OUTPUT_VAR DEFAULT) + set(multiValueArgs COMMAND) + cmake_parse_arguments(GIT_RUN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - execute_process(COMMAND ${GIT_EXECUTABLE} ${GIT_RUN_COMMAND} - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - RESULT_VARIABLE GIT_RESULTVAR - OUTPUT_VARIABLE GIT_OUTVAR - OUTPUT_STRIP_TRAILING_WHITESPACE - ) + execute_process(COMMAND ${GIT_EXECUTABLE} ${GIT_RUN_COMMAND} + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + RESULT_VARIABLE GIT_RESULTVAR + OUTPUT_VARIABLE GIT_OUTVAR + OUTPUT_STRIP_TRAILING_WHITESPACE + ) - if(GIT_RESULTVAR EQUAL 0) - set(${GIT_RUN_OUTPUT_VAR} "${GIT_OUTVAR}" PARENT_SCOPE) - else() - set(${GIT_RUN_OUTPUT_VAR} ${GIT_RUN_DEFAULT}) - message(STATUS "Failed to run Git: ${GIT_OUTVAR}") - endif() + if(GIT_RESULTVAR EQUAL 0) + set(${GIT_RUN_OUTPUT_VAR} "${GIT_OUTVAR}" PARENT_SCOPE) + else() + set(${GIT_RUN_OUTPUT_VAR} ${GIT_RUN_DEFAULT}) + message(STATUS "Failed to run Git: ${GIT_OUTVAR}") + endif() endfunction() else() function(git_run) - set(oneValueArgs OUTPUT_VAR DEFAULT) - set(multiValueArgs COMMAND) - cmake_parse_arguments(GIT_RUN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - set(${GIT_RUN_OUTPUT_VAR} ${GIT_RUN_DEFAULT}) + set(oneValueArgs OUTPUT_VAR DEFAULT) + set(multiValueArgs COMMAND) + cmake_parse_arguments(GIT_RUN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + set(${GIT_RUN_OUTPUT_VAR} ${GIT_RUN_DEFAULT}) endfunction(git_run) endif() |