PageRenderTime 6ms CodeModel.GetById 2ms app.highlight 2ms RepoModel.GetById 0ms app.codeStats 1ms

/indra/cmake/Externals.cmake

https://bitbucket.org/lindenlab/viewer-beta/
CMake | 34 lines | 31 code | 2 blank | 1 comment | 6 complexity | e1d7548f475adc92441f29fff6670a1d MD5 | raw file
 1# -*- cmake -*-
 2
 3include(Python)
 4include(FindSVN)
 5
 6macro (use_svn_external _binary _path _url _rev)
 7  if (NOT STANDALONE)
 8    if(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed)
 9      if(SVN_FOUND)
10        if(DEBUG_EXTERNALS)
11          message("cd ${_path} && ${SVN_EXECUTABLE} checkout -r ${_rev} ${_url} ${_binary}")
12        endif(DEBUG_EXTERNALS)
13        execute_process(COMMAND ${SVN_EXECUTABLE}
14          checkout
15          -r ${_rev}
16          ${_url}
17          ${_binary}
18          WORKING_DIRECTORY ${_path}
19          RESULT_VARIABLE ${_binary}_installed
20          )
21      else(SVN_FOUND)
22        message(FATAL_ERROR "Failed to find SVN_EXECUTABLE")
23      endif(SVN_FOUND)
24      file(WRITE ${CMAKE_BINARY_DIR}/temp/${_binary}_installed "${${_binary}_installed}")
25    else(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed)
26      set(${_binary}_installed 0)
27    endif(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed)
28    if(NOT ${_binary}_installed EQUAL 0)
29      message(FATAL_ERROR
30              "Failed to download or unpack prebuilt '${_binary}'."
31              " Process returned ${${_binary}_installed}.")
32    endif (NOT ${_binary}_installed EQUAL 0)
33  endif (NOT STANDALONE)
34endmacro (use_svn_external _binary _path _url _rev)