cpm-cmake / CPM.cmake

📦 CMake's missing package manager. A small CMake script for setup-free, cross-platform, reproducible dependency management.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

(bug) fetch error

hsdk123 opened this issue · comments

Hi, I notice with the below configuration, cmake doesn't seem to be able to find the nlohmann_json::nlohmann_json target

CPMAddPackage(json
  GIT_REPOSITORY https://github.com/ArthurSonzogni/nlohmann_json_cmake_fetchcontent.git
  GIT_TAG v3.9.1
  SYSTEM
)

the below works fine

CPMAddPackage(json
  GIT_REPOSITORY https://github.com/nlohmann/json.git
  GIT_TAG v3.9.1
  SYSTEM
)

Without looking closely at the difference between the two repos I believe this is most likely an issue with the nlohmann_json_cmake_fetchcontent.git as it does not seem to define the nlohmann_json::nlohmann_json target alias. Maybe create an issue in the nlohmann_json_cmake_fetchcontent project itself, as they should be able to fix it?

Note: The SYSTEM should be set to a truthy value!

I.e.: SYSTEM ON