summaryrefslogtreecommitdiffstats
path: root/Source/CMakeVersionSource.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CMakeVersionSource.cmake')
-rw-r--r--Source/CMakeVersionSource.cmake4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/CMakeVersionSource.cmake b/Source/CMakeVersionSource.cmake
index 05e265c..888f557 100644
--- a/Source/CMakeVersionSource.cmake
+++ b/Source/CMakeVersionSource.cmake
@@ -30,8 +30,8 @@ if(EXISTS ${CMake_SOURCE_DIR}/.git/HEAD)
elseif(EXISTS ${CMake_SOURCE_DIR}/CVS/Repository)
file(READ ${CMake_SOURCE_DIR}/CVS/Repository repo)
set(branch "")
- if("${repo}" MATCHES "\\.git/")
- string(REGEX REPLACE ".*\\.git/([^\r\n]*).*" "-\\1" branch "${repo}")
+ if("${repo}" MATCHES "\\.git/([^\r\n]*)")
+ set(branch "${CMAKE_MATCH_1}")
endif()
set(CMake_VERSION_SOURCE "cvs${branch}")
endif()