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

Question about different header files including ways

JingLiofLiJing opened this issue · comments

Hi there,

I'm using CPM to manage 3rd libraries of my project recently. However, I'm facing a problem about two different header files including paradigms (fmtlib/fmt for example).

When fmt has been built and installed firstly, I can use CPMFindPackage(...) to import this local library, the header file can be include like:

#include <fmt/format.h>

However, if I use CPMAddPackage(...) to download、configure and build fmt, related paths should be like:

fmt_SOURCE_DIR = .../_deps/fmt-src
fmt_BINARY_DIR   = .../_deps/fmt-build
#include <fmt/format.h>  # error not found
#include <format.h>        # passed!

Is it now possible to make above two import ways to maintain the same including paradigm(like #include <fmt/format.h>)?

I don't have any issue with:

CPMAddPackage(
  NAME fmt
  GIT_REPOSITORY "https://github.com/fmtlib/fmt"
  GIT_TAG "9.1.0"
)

You should provide a reproducible example.