/indra/cmake/BuildVersion.cmake

https://bitbucket.org/lindenlab/viewer-beta/ · CMake · 18 lines · 14 code · 3 blank · 1 comment · 2 complexity · 9f05d739421905437c923d726b5bbc0b MD5 · raw file

  1. # -*- cmake -*-
  2. include(Python)
  3. macro (build_version _target)
  4. execute_process(
  5. COMMAND ${PYTHON_EXECUTABLE} ${SCRIPTS_DIR}/build_version.py
  6. llversion${_target}.h ${LLCOMMON_INCLUDE_DIRS}
  7. OUTPUT_VARIABLE ${_target}_VERSION
  8. OUTPUT_STRIP_TRAILING_WHITESPACE
  9. )
  10. if (${_target}_VERSION)
  11. message(STATUS "Version of ${_target} is ${${_target}_VERSION}")
  12. else (${_target}_VERSION)
  13. message(SEND_ERROR "Could not determine ${_target} version")
  14. endif (${_target}_VERSION)
  15. endmacro (build_version)