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

游戏引擎

开发平台:

C++ Builder

  1. # -*- cmake -*-
  2. include(Python)
  3. include(FindSCP)
  4. macro (use_prebuilt_binary _binary)
  5.   if (NOT STANDALONE)
  6.     if(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed)
  7.       if(INSTALL_PROPRIETARY)
  8.         include(FindSCP)
  9.         if(DEBUG_PREBUILT)
  10.           message("cd ${SCRIPTS_DIR} && ${PYTHON_EXECUTABLE} install.py --install-dir=${CMAKE_SOURCE_DIR}/.. --scp=${SCP_EXECUTABLE} ${_binary}")
  11.         endif(DEBUG_PREBUILT)
  12.         execute_process(COMMAND ${PYTHON_EXECUTABLE}
  13.           install.py 
  14.           --install-dir=${CMAKE_SOURCE_DIR}/..
  15.           --scp=${SCP_EXECUTABLE}
  16.           ${_binary}
  17.           WORKING_DIRECTORY ${SCRIPTS_DIR}
  18.           RESULT_VARIABLE ${_binary}_installed
  19.           )
  20.       else(INSTALL_PROPRIETARY)
  21.         if(DEBUG_PREBUILT)
  22.           message("cd ${SCRIPTS_DIR} && ${PYTHON_EXECUTABLE} install.py --install-dir=${CMAKE_SOURCE_DIR}/.. ${_binary}")
  23.         endif(DEBUG_PREBUILT)
  24.         execute_process(COMMAND ${PYTHON_EXECUTABLE}
  25.           install.py 
  26.           --install-dir=${CMAKE_SOURCE_DIR}/..
  27.           ${_binary}
  28.           WORKING_DIRECTORY ${SCRIPTS_DIR}
  29.           RESULT_VARIABLE ${_binary}_installed
  30.           )
  31.       endif(INSTALL_PROPRIETARY)
  32.       file(WRITE ${CMAKE_BINARY_DIR}/temp/${_binary}_installed "${${_binary}_installed}")
  33.     else(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed)
  34.       set(${_binary}_installed 0)
  35.     endif(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed)
  36.     if(NOT ${_binary}_installed EQUAL 0)
  37.       message(FATAL_ERROR
  38.               "Failed to download or unpack prebuilt '${_binary}'."
  39.               " Process returned ${${_binary}_installed}.")
  40.     endif (NOT ${_binary}_installed EQUAL 0)
  41.   endif (NOT STANDALONE)
  42. endmacro (use_prebuilt_binary _binary)