Changeset 14729


Ignore:
Timestamp:
Apr 3, 2016, 5:53:32 AM (6 years ago)
Author:
mikedld
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CMakeLists.txt

    r14728 r14729  
    6161
    6262if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.svn)
    63     find_package(Subversion)
    64     if(Subversion_FOUND)
    65         Subversion_WC_INFO(${CMAKE_SOURCE_DIR} TR_SVN)
    66         set(TR_SCM_REVISION "${TR_SVN_WC_REVISION}")
     63    if(NOT "$ENV{JENKINS_URL}" STREQUAL "" AND NOT "$ENV{SVN_REVISION}" STREQUAL "")
     64        # Jenkins automated build, use the set environment variables to avoid
     65        # version mismatches between java's svn and command line's svn
     66        set(TR_SCM_REVISION "$ENV{SVN_REVISION}")
     67    else()
     68        find_package(Subversion)
     69        if(Subversion_FOUND)
     70            Subversion_WC_INFO(${CMAKE_SOURCE_DIR} TR_SVN)
     71            set(TR_SCM_REVISION "${TR_SVN_WC_REVISION}")
     72        endif()
    6773    endif()
    6874elseif(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.git)
Note: See TracChangeset for help on using the changeset viewer.