Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variables to manage default repositories URLs #528

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions cmake/CPM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,18 @@ set(CPM_DRY_RUN
OFF
CACHE INTERNAL "Don't download or configure dependencies (for testing)"
)
set(CPM_GITHUB_REPOSITORY_URL
"github.com"
CACHE INTERNAL ""
)
set(CPM_GITLAB_REPOSITORY_URL
"gitlab.com"
CACHE INTERNAL ""
)
set(CPM_BITBUCKET_REPOSITORY_URL
"bitbucket.org"
CACHE INTERNAL ""
)

if(DEFINED ENV{CPM_SOURCE_CACHE})
set(CPM_SOURCE_CACHE_DEFAULT $ENV{CPM_SOURCE_CACHE})
Expand Down Expand Up @@ -561,11 +573,11 @@ function(CPMAddPackage)
endif()

if(DEFINED CPM_ARGS_GITHUB_REPOSITORY)
set(CPM_ARGS_GIT_REPOSITORY "https://github.com/${CPM_ARGS_GITHUB_REPOSITORY}.git")
set(CPM_ARGS_GIT_REPOSITORY "https://${CPM_GITHUB_REPOSITORY_URL}/${CPM_ARGS_GITHUB_REPOSITORY}.git")
elseif(DEFINED CPM_ARGS_GITLAB_REPOSITORY)
set(CPM_ARGS_GIT_REPOSITORY "https://gitlab.com/${CPM_ARGS_GITLAB_REPOSITORY}.git")
set(CPM_ARGS_GIT_REPOSITORY "https://${CPM_GITLAB_REPOSITORY_URL}/${CPM_ARGS_GITLAB_REPOSITORY}.git")
elseif(DEFINED CPM_ARGS_BITBUCKET_REPOSITORY)
set(CPM_ARGS_GIT_REPOSITORY "https://bitbucket.org/${CPM_ARGS_BITBUCKET_REPOSITORY}.git")
set(CPM_ARGS_GIT_REPOSITORY "https://${CPM_BITBUCKET_REPOSITORY_URL}/${CPM_ARGS_BITBUCKET_REPOSITORY}.git")
endif()

if(DEFINED CPM_ARGS_GIT_REPOSITORY)
Expand Down