CPM.cmake icon indicating copy to clipboard operation
CPM.cmake copied to clipboard

Single-argument and infer name support for CPMFindPackage

Open JohelEGP opened this issue 4 years ago • 1 comments

Currently, CPMFindPackage("gh:gsl-lite/gsl-lite#master") and

CPMFindPackage(
    GITHUB_REPOSITORY gsl-lite/gsl-lite
    GIT_TAG master
    GIT_SHALLOW True)

both fail with

/home/johel/tmp/build-jge/_deps/cpm-src/cmake/CPM.cmake:204: error: cpm_check_if_package_already_added Function invoked with incorrect arguments for function named: cpm_check_if_package_already_added tools/cmake/JGEFindDependencies.cmake:55 (CPMFindPackage) CMakeLists.txt:11 (include)

Is it possible to extend this support to CPMFindPackage? Otherwise, I think this difference should be documented.

JohelEGP avatar Feb 22 '21 21:02 JohelEGP

Yes, CPMFindPackage doesn't support the shorthand syntax (yet?). The discussion about this is in #208

iboB avatar Feb 23 '21 06:02 iboB