Comments (6)
Technically we could make use of git ls-remote
to query available tags and see whether they are in the form of "A.B.C" or "vA.B.C". However I think that something like this is too big and risky to do at this point. Perhaps it's a good idea for the (not-so-near) future
from cpm.cmake.
nvm just found GIT_TAG
param.
But to be honest the VERSION
parameter is a bit confusing, what's the benefit of having an extra VERSION
option instead of just GIT_TAG
from cpm.cmake.
Hey, I'm glad you solved it! In general, the GIT_TAG
is for the git tag and the version is for specifying the (lexical) version number of the package, so CPM.cmake is able to emit a warning when a dependency asks for a more recent version of a dependency than currently used. As different packages will ask for different versions of a dependency, the idea is to have them available in a minimum required version.
As the tag and the version are often closely related we decided it would be convenient to have CPM.cmake set VERSION
to <GIT_TAG>
, or GIT_TAG
to v<VERSION>
if one or the other is not explicitly specified.
from cpm.cmake.
As this has been marked a duplicate of similar issues, I will answer in here:
I agree with your comments @TheLartians that prefixing with v is common (and recommend by GitHub). I do think that a version number without any v prefix is very common as well.
So to make life a little bit easier why not support both?
If this is something that could be implemented, maybe the issue should be reopened
from cpm.cmake.
@Leon0402 I agree, which is why the version is automatically inferred If only the GIT_TAG
is provided in a suitable format. Also note the shorthand syntax, that supports an easy notation for providing only the tag.
# A git package from a given uri with a version
CPMAddPackage("uri@version")
# A git package from a given uri with a git tag or commit hash
CPMAddPackage("uri#tag")
# A git package with both version and tag provided
CPMAddPackage("uri@version#tag")
For example, the range-v3
can be fetched using simply CPMAddPackage("gh:ericniebler/range-v3#0.11.0")
and CPM.cmake will infer the correct version from the tag.
from cpm.cmake.
Is version
able to be something other than a tag then? There are 3rd party repos without tags I wish to use in my current project where I am using CPM manager for all 3rd party package management for the first time.
EDIT:
Literally straight after sending this I thought to try #0
for the tagless repo and it worked! Nice touch
from cpm.cmake.
Related Issues (20)
- Can you help with compiling `libtins` library using CPM?
- cpm git fetch is occasionally empty HOT 1
- Cache: failure when the download is aborted and the download dir is empty HOT 3
- Add support for ExternalProject_Add() / libjpeg HOT 3
- Feature Request: Short syntax in long syntax. HOT 1
- Don't unconditionally download in get_cpm.cmake HOT 5
- Add example for using the `libuv` repository HOT 2
- CPM name of the package MUST NOT be exported target name HOT 2
- Using CPM_dep_SOURCE appears to work, but includes are not found HOT 4
- when use cache the depends lib appeared outside the project in clion HOT 2
- Users in enterprise environments require the ability to add custom URI schemes and override standard URI schemes
- Fast skip dependencies
- CMake 3.30: Calling FetchContent_Populate() is deprecated HOT 2
- Lua example is broken? HOT 1
- Shallow submodules HOT 1
- Incorrect find patch program under win32 HOT 2
- Skip fetch only works when `CPM_SOURCE_CACHE` is defined
- Use CPM to build Apache Arrow HOT 2
- package lock with boost HOT 1
- `PATCH_COMMAND` via `FILE` manipulation doesn't seem to get cached HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpm.cmake.