Author: dgregor
Date: Wed Sep 16 16:59:05 2009
New Revision: 82085

URL: http://llvm.org/viewvc/llvm-project?rev=82085&view=rev
Log:
The CMake build system now derives the Clang version number from VER.

Modified:
    cfe/trunk/CMakeLists.txt

Modified: cfe/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/CMakeLists.txt?rev=82085&r1=82084&r2=82085&view=diff

==============================================================================
--- cfe/trunk/CMakeLists.txt (original)
+++ cfe/trunk/CMakeLists.txt Wed Sep 16 16:59:05 2009
@@ -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})


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to