Skip to content
Snippets Groups Projects
Commit ff4779c0 authored by Naumann, Andreas's avatar Naumann, Andreas
Browse files

subminor revision does not fail with svn exported directories

parent 89678d64
No related branches found
No related tags found
No related merge requests found
#this files sets the cmake variable AMDIS_SUB_MINOR to the subversion global revision
#if the global revision could not be determined, the variable remains empty
#TODO: git compatibility
macro(Subversion_CHECK_WC dir prefix)
set(_Subversion_SAVED_LC_ALL "$ENV{LC_ALL}")
set(ENV{LC_ALL} C)
execute_process(COMMAND ${Subversion_SVN_EXECUTABLE} info ${dir}
OUTPUT_VARIABLE ${prefix}_WC_INFO
ERROR_VARIABLE Subversion_svn_info_error
RESULT_VARIABLE Subversion_svn_info_result
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(${Subversion_svn_info_result} EQUAL 0)
set(${prefix} TRUE)
#message(SEND_ERROR "Command \"${Subversion_SVN_EXECUTABLE} info ${dir}\" failed with output:\n${Subversion_svn_info_error}")
else()
set(${prefix} FALSE)
endif()
# restore the previous LC_ALL
set(ENV{LC_ALL} ${_Subversion_SAVED_LC_ALL})
endmacro()
find_package(Subversion)
if(Subversion_FOUND)
Subversion_WC_INFO(${CMAKE_CURRENT_SOURCE_DIR} svn_info)
#message("svn-rev: ${svn_info_WC_REVISION}")
set(AMDIS_SUB_MINOR "${svn_info_WC_REVISION}")
#CMake Version 3.5.2: fatal error in Subversion_WC_INFO if CMAKE_CURRENT_SOURCE_DIR is not a working directory
Subversion_CHECK_WC(${CMAKE_CURRENT_SOURCE_DIR} svn_check)
if(svn_check)
Subversion_WC_INFO(${CMAKE_CURRENT_SOURCE_DIR} svn_info)
#message("svn-rev: ${svn_info_WC_REVISION}")
set(AMDIS_SUB_MINOR "${svn_info_WC_REVISION}")
endif()
endif()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment