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:
parent
caaca040bd
commit
1cb17447dc
1 changed files with 10 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue