aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-06-25 17:33:46 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-06-25 17:33:46 +0000
commita510767963e6bf04f0bc15de057f6bafa0aedab5 (patch)
treef859410ef37c427ffd82f259ca0386b09151984e /CMakeLists.txt
parentb24e199fbd17af780ab000c5862d191e4daffc0f (diff)
build: Add a generated Version.inc file instead of duplicating information.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106863 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt17
1 files changed, 17 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e366275af9..6154fdb66f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -34,6 +34,23 @@ string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION
${CLANG_VERSION_DATA})
message(STATUS "Clang version: ${CLANG_VERSION}")
+string(REGEX REPLACE "([0-9]+)\\.[0-9]+(\\.[0-9]+)?" "\\1" CLANG_VERSION_MAJOR
+ ${CLANG_VERSION})
+string(REGEX REPLACE "[0-9]+\\.([0-9]+)(\\.[0-9]+)?" "\\1" CLANG_VERSION_MINOR
+ ${CLANG_VERSION})
+if (${CLANG_VERSION} MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")
+ set(CLANG_HAS_VERSION_PATCHLEVEL 1)
+ string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" CLANG_VERSION_PATCHLEVEL
+ ${CLANG_VERSION})
+else()
+ set(CLANG_HAS_VERSION_PATCHLEVEL 0)
+endif()
+
+# Configure the Version.inc file.
+configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/include/clang/Basic/Version.inc.in
+ ${CMAKE_CURRENT_BINARY_DIR}/include/clang/Basic/Version.inc)
+
# Add appropriate flags for GCC
if (CMAKE_COMPILER_IS_GNUCXX)
# FIXME: Turn off exceptions, RTTI: