-
Notifications
You must be signed in to change notification settings - Fork 190
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
Users in enterprise environments require the ability to add custom URI schemes and override standard URI schemes #564
Comments
k-channon-PA
added a commit
to k-channon-PA/CPM.cmake
that referenced
this issue
Jun 9, 2024
k-channon-PA
added a commit
to k-channon-PA/CPM.cmake
that referenced
this issue
Jun 10, 2024
…some logic; Make updated cpm_parse_add_package_single_arg have behaviour more consistent with the pre-user-definable-uri-schemes version (cpm-cmake#564)
k-channon-PA
added a commit
to k-channon-PA/CPM.cmake
that referenced
this issue
Jun 10, 2024
k-channon-PA
added a commit
to k-channon-PA/CPM.cmake
that referenced
this issue
Jun 17, 2024
k-channon-PA
added a commit
to k-channon-PA/CPM.cmake
that referenced
this issue
Jun 17, 2024
…some logic; Make updated cpm_parse_add_package_single_arg have behaviour more consistent with the pre-user-definable-uri-schemes version (cpm-cmake#564)
k-channon-PA
added a commit
to k-channon-PA/CPM.cmake
that referenced
this issue
Jun 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TL;DR
As a user of CPM in a corporate environment
I would like to be able to override the URIs and extensions used for single- and multi-argument versions of CPMAddPackage
So that I can use CPM behind my company firewall and use our internal repos, mirrors and binary stores
Here's a CPM fork that has an implementation of this proposal in it: https://github.com/k-channon-PA/CPM.cmake
(Disclaimer: this is my first complicatd CMake thing, so it might not conform to the CPM best practices entirely. I did use the formatter thing though :) )
Proposed syntax
The syntax for adding/overriding a URI scheme would look like:
Then packages could be added via a single argument call to
CPMAddPackage
like:Or, a multi-arg call like:
If a scheme with the same alias is already defined, then it should be overwritten with the new value. In this way, I can redirect all "gl" packages to our internal repository mirror, instead of the one on the public internet.
I added some tests for the single-argument case that exercise a bunch of dummy use-cases. I heven't yet added anything to the "examples" directory, because that looked like a bit more work and I wanted to get some feedback on the implementation and idea before taking some more time on it.
Why not just use Git config to redirect URLs from the public to our internal repos?
Doing this interferes with other things using Git that are not CPM. I would like the flexibility to control the behaviour of CPM in isolation.
In an enterprise environment, everything requires credentials to access it. I think the proposed mechanism could be extended allow us to provide custom HTTP_HEADER arguments when defining URI schemes. This means that I can provide use creds/tokens for accessing internal Bitbucket, or Artifactory servers, etc.
The text was updated successfully, but these errors were encountered: