Skip to content

Commit

Permalink
better regex pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
2bndy5 committed Jun 7, 2021
1 parent 5109a13 commit eabc7af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmake/GetLibInfo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit eabc7af

Please # to comment.