summaryrefslogtreecommitdiff
path: root/indra/cmake/BuildVersion.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'indra/cmake/BuildVersion.cmake')
-rw-r--r--indra/cmake/BuildVersion.cmake18
1 files changed, 18 insertions, 0 deletions
diff --git a/indra/cmake/BuildVersion.cmake b/indra/cmake/BuildVersion.cmake
new file mode 100644
index 0000000000..60a519c9af
--- /dev/null
+++ b/indra/cmake/BuildVersion.cmake
@@ -0,0 +1,18 @@
+# -*- cmake -*-
+
+include(Python)
+
+macro (build_version _target)
+ execute_process(
+ COMMAND ${PYTHON_EXECUTABLE} ${SCRIPTS_DIR}/build_version.py
+ llversion${_target}.h ${LLCOMMON_INCLUDE_DIRS}
+ OUTPUT_VARIABLE ${_target}_VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+
+ if (${_target}_VERSION)
+ message(STATUS "Version of ${_target} is ${${_target}_VERSION}")
+ else (${_target}_VERSION)
+ message(SEND_ERROR "Could not determine ${_target} version")
+ endif (${_target}_VERSION)
+endmacro (build_version)