Index: CMakeLists.txt =================================================================== --- CMakeLists.txt +++ CMakeLists.txt @@ -109,8 +109,10 @@ option(LLVM_APPEND_VC_REV "Append the version control system revision id to LLVM version" OFF) +add_version_info_from_vcs(LLVM_REVISION) if( LLVM_APPEND_VC_REV ) - add_version_info_from_vcs(PACKAGE_VERSION) + string(REPLACE "svn" "" PACKAGE_VERSION "${PACKAGE_VERSION}") + set(PACKAGE_VERSION "${PACKAGE_VERSION}${LLVM_REVISION}") endif() set(PACKAGE_NAME LLVM) Index: include/llvm/Config/config.h.cmake =================================================================== --- include/llvm/Config/config.h.cmake +++ include/llvm/Config/config.h.cmake @@ -496,6 +496,9 @@ /* Patch version of the LLVM API */ #define LLVM_VERSION_PATCH ${LLVM_VERSION_PATCH} +/* LLVM revision as a string */ +#define LLVM_REVISION_STRING "${LLVM_REVISION}" + /* LLVM version string */ #define LLVM_VERSION_STRING "${PACKAGE_VERSION}" Index: include/llvm/Config/llvm-config.h.cmake =================================================================== --- include/llvm/Config/llvm-config.h.cmake +++ include/llvm/Config/llvm-config.h.cmake @@ -99,6 +99,9 @@ /* Patch version of the LLVM API */ #define LLVM_VERSION_PATCH ${LLVM_VERSION_PATCH} +/* LLVM revision as a string */ +#define LLVM_REVISION_STRING "${LLVM_REVISION}" + /* LLVM version string */ #define LLVM_VERSION_STRING "${PACKAGE_VERSION}"