From eabc7af12cfa83a67c5100de328bad9e0c5f355f Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Mon, 7 Jun 2021 01:35:07 -0700 Subject: [PATCH] better regex pattern --- cmake/GetLibInfo.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/GetLibInfo.cmake b/cmake/GetLibInfo.cmake index f1479de..3bd2dd9 100644 --- a/cmake/GetLibInfo.cmake +++ b/cmake/GetLibInfo.cmake @@ -3,11 +3,11 @@ execute_process(COMMAND git config --get remote.origin.url OUTPUT_VARIABLE CMAKE string(STRIP CMAKE_PROJECT_HOMEPAGE_URL ${CMAKE_PROJECT_HOMEPAGE_URL}) # use URL to get repo owner as Contact/Maintainer name -string(REGEX REPLACE "^http[s]?://github.com/(.+)/.+[\\.git]?.*&" "\\1" CPACK_PACKAGE_CONTACT "${CMAKE_PROJECT_HOMEPAGE_URL}") +string(REGEX REPLACE "^http[s]?:\/\/github.com\/(.+)\/.+[\\.git]?.*" "\\1" CPACK_PACKAGE_CONTACT "${CMAKE_PROJECT_HOMEPAGE_URL}") string(STRIP "${CPACK_PACKAGE_CONTACT}" CPACK_PACKAGE_CONTACT) # use URL to get the repo name as the Lib Name. Note that we don't use the folder name for this -string(REGEX REPLACE "^http[s]?://github.com/.+/(.+)[\\.git]?.*&" "\\1" LibName "${CMAKE_PROJECT_HOMEPAGE_URL}") +string(REGEX REPLACE "^http[s]?:\/\/github\\.com\/.+\/(.+)[\\.git]?.*" "\\1" LibName "${CMAKE_PROJECT_HOMEPAGE_URL}") string(STRIP "${LibName}" LibName) # convert the LibName to lower case