1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-23 16:24:02 +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,11 +60,17 @@ set(TR_SCM_REVISION_FILE "${CMAKE_SOURCE_DIR}/REVISION")
set(TR_SCM_REVISION_RELIABLE ON)
if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.svn)
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)
if(GIT_FOUND)