Externals.cmake
上传用户:king477883
上传日期:2021-03-01
资源大小:9553k
文件大小:1k
源码类别:

游戏引擎

开发平台:

C++ Builder

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