mirror of
https://github.com/cpm-cmake/CPM.cmake.git
synced 2026-02-06 06:45:58 +08:00
Improved regex match in cpm_package_name_from_git_uri (#206)
This commit is contained in:
committed by
GitHub
parent
4cbf443363
commit
4aadac1972
@@ -136,8 +136,7 @@ include(CMakeParseArguments)
|
|||||||
|
|
||||||
# Infer package name from git repository uri (path or url)
|
# Infer package name from git repository uri (path or url)
|
||||||
function(cpm_package_name_from_git_uri URI RESULT)
|
function(cpm_package_name_from_git_uri URI RESULT)
|
||||||
string(REGEX MATCH "([^/:]+)/?.git/?$" cpmGitUriMatch "${URI}")
|
if("${URI}" MATCHES "([^/:]+)/?.git/?$")
|
||||||
if(DEFINED cpmGitUriMatch)
|
|
||||||
set(${RESULT}
|
set(${RESULT}
|
||||||
${CMAKE_MATCH_1}
|
${CMAKE_MATCH_1}
|
||||||
PARENT_SCOPE
|
PARENT_SCOPE
|
||||||
|
|||||||
Reference in New Issue
Block a user