jbeder / yaml-cpp

A YAML parser and emitter in C++
MIT License
4.91k stars 1.77k forks source link

How to import yaml-cpp to my project using yaml-cpp-config.cmake? #1288

Closed Lqs66 closed 1 week ago

Lqs66 commented 1 week ago

I built yaml-cpp from source outside of my project, but I don't want to run make install. To do so, I used find_package(yaml-cpp CONFIG HINTS ${YAML_CPP_DIR} ${YAML_CPP_BIN}) in my project. The command successfully finds the yaml-cpp-config.cmake file in the buildfolder, but it throws the following error:

CMake Error at /home/lqs66/Desktop/model-checking-flight-control/yaml-cpp/build/yaml-cpp-config.cmake:18 (message):
  File or directory /home/lqs66/Desktop/include referenced by variable
  YAML_CPP_INCLUDE_DIR does not exist !
Call Stack (most recent call first):
  /home/lqs66/Desktop/model-checking-flight-control/yaml-cpp/build/yaml-cpp-config.cmake:34 (set_and_check)
  base/CMakeLists.txt:22 (find_package)
jbeder commented 1 week ago

I'd ask this on Stack Overflow.