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:
parent
caaca040bd
commit
1cb17447dc
1 changed files with 10 additions and 4 deletions
|
@ -60,11 +60,17 @@ set(TR_SCM_REVISION_FILE "${CMAKE_SOURCE_DIR}/REVISION")
|
||||||
set(TR_SCM_REVISION_RELIABLE ON)
|
set(TR_SCM_REVISION_RELIABLE ON)
|
||||||
|
|
||||||
if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.svn)
|
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)
|
find_package(Subversion)
|
||||||
if(Subversion_FOUND)
|
if(Subversion_FOUND)
|
||||||
Subversion_WC_INFO(${CMAKE_SOURCE_DIR} TR_SVN)
|
Subversion_WC_INFO(${CMAKE_SOURCE_DIR} TR_SVN)
|
||||||
set(TR_SCM_REVISION "${TR_SVN_WC_REVISION}")
|
set(TR_SCM_REVISION "${TR_SVN_WC_REVISION}")
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
elseif(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.git)
|
elseif(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.git)
|
||||||
find_package(Git)
|
find_package(Git)
|
||||||
if(GIT_FOUND)
|
if(GIT_FOUND)
|
||||||
|
|
Loading…
Reference in a new issue