/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. 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)