diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-06-25 17:33:46 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-06-25 17:33:46 +0000 |
commit | a510767963e6bf04f0bc15de057f6bafa0aedab5 (patch) | |
tree | f859410ef37c427ffd82f259ca0386b09151984e /CMakeLists.txt | |
parent | b24e199fbd17af780ab000c5862d191e4daffc0f (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.txt | 17 |
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: |