diff --git a/CMakeLists.txt b/CMakeLists.txt index aa1a0f0eb..bd98df58b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)