1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-23 08:13:27 +00:00

Try getting SVN revision from Jenkins environment when using CMake (copy logic from update-version-h.sh)

This commit is contained in:
Mike Gelfand 2016-04-03 05:53:32 +00:00
parent caaca040bd
commit 1cb17447dc

View file

@ -60,10 +60,16 @@ set(TR_SCM_REVISION_FILE "${CMAKE_SOURCE_DIR}/REVISION")
set(TR_SCM_REVISION_RELIABLE ON)
if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.svn)
find_package(Subversion)
if(Subversion_FOUND)
Subversion_WC_INFO(${CMAKE_SOURCE_DIR} TR_SVN)
set(TR_SCM_REVISION "${TR_SVN_WC_REVISION}")
if(NOT "$ENV{JENKINS_URL}" STREQUAL "" AND NOT "$ENV{SVN_REVISION}" STREQUAL "")
# Jenkins automated build, use the set environment variables to avoid
# version mismatches between java's svn and command line's svn
set(TR_SCM_REVISION "$ENV{SVN_REVISION}")
else()
find_package(Subversion)
if(Subversion_FOUND)
Subversion_WC_INFO(${CMAKE_SOURCE_DIR} TR_SVN)
set(TR_SCM_REVISION "${TR_SVN_WC_REVISION}")
endif()
endif()
elseif(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.git)
find_package(Git)