summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-09-16 21:59:05 +0000
committerDouglas Gregor <dgregor@apple.com>2009-09-16 21:59:05 +0000
commit34d9ffaafd93525bf7965901cf360b80f92ff0f4 (patch)
treef3a967c5798ea3c4ef94cf6b28c68e3e8f386228 /CMakeLists.txt
parentb123ea395ee607de85161f84c6e78595946304a5 (diff)
downloadclang-34d9ffaafd93525bf7965901cf360b80f92ff0f4.tar.gz
The CMake build system now derives the Clang version number from VER.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82085 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt13
1 files changed, 11 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6ed32d9578..4dedcfd6fd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,15 @@
# Clang version information
-# FIXME: get from a file called ./VER
-set(CLANG_VERSION 1.1)
+
+# Make sure that CMake reconfigures when the version changes.
+configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/VER
+ ${CMAKE_CURRENT_BINARY_DIR}/VER)
+
+# Compute the Clang version from the contents of VER
+file(READ ${CMAKE_CURRENT_SOURCE_DIR}/VER CLANG_VERSION_DATA)
+string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION
+ ${CLANG_VERSION_DATA})
+message(STATUS "Clang version: ${CLANG_VERSION}")
macro(add_clang_library name)
set(srcs ${ARGN})