Skip to content

Commit 4aadac1

Browse files
authored
Improved regex match in cpm_package_name_from_git_uri (#206)
1 parent 4cbf443 commit 4aadac1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

cmake/CPM.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,7 @@ include(CMakeParseArguments)
136136

137137
# Infer package name from git repository uri (path or url)
138138
function(cpm_package_name_from_git_uri URI RESULT)
139-
string(REGEX MATCH "([^/:]+)/?.git/?$" cpmGitUriMatch "${URI}")
140-
if(DEFINED cpmGitUriMatch)
139+
if("${URI}" MATCHES "([^/:]+)/?.git/?$")
141140
set(${RESULT}
142141
${CMAKE_MATCH_1}
143142
PARENT_SCOPE

0 commit comments

Comments
 (0)