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

load fmt as external fail #98

Closed
westfly opened this issue Mar 8, 2020 · 2 comments · Fixed by #100
Closed

load fmt as external fail #98

westfly opened this issue Mar 8, 2020 · 2 comments · Fixed by #100
Labels
enhancement New feature or request help desk

Comments

@westfly
Copy link

westfly commented Mar 8, 2020

the tag of fmt has no v prefix

6.1.0
6.1.1
6.1.2
qls
v0.11.0

default strategy will add v prefix to VERSION supplying by user.

148   if (NOT DEFINED CPM_ARGS_GIT_TAG) 
149     set(CPM_ARGS_GIT_TAG v${CPM_ARGS_VERSION}) 
150   endif()

should we give an option to handle this situation as well as VERSION equal master?

@TheLartians
Copy link
Member

TheLartians commented Mar 15, 2020

Packages not using v-prefixed tags require specifying GIT_TAG explicitly and additionally to VERSION, which I agree isn't optimal. I think it makes sense to assume the v-prefix by default as it seems to be most common convention on GitHub, but also to provide an option to override this on a per-package basis.

Maybe we should add an option VERSION_PREFIX to the package definition to avoid the duplicate version specification. e.g.

CPMAddPackage(
  NAME fmt
  VERSION 6.1.2
  GITHUB_REPOSITORY fmtlib/fmt
  VERSION_PREFIX ""
)

@TheLartians
Copy link
Member

TheLartians commented Mar 16, 2020

As it turns out, CMake did not support empty arguments until very recently, which is why using VERSION_PREFIX "" will not work. Currently however CPM can take the version from GIT_TAG as well, reducing the need for double specification as well. So the current "correct" way to add fmt would be the following.

CPMAddPackage(
  NAME fmt
  GIT_TAG 6.1.2 # CPM can detect the version from this tag
  GITHUB_REPOSITORY fmtlib/fmt
)

I will update the documentation and add fmt as an example accordingly.

@TheLartians TheLartians added enhancement New feature or request help desk labels Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help desk
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants