matplotlib-cpp icon indicating copy to clipboard operation
matplotlib-cpp copied to clipboard

Fix CMake library include_directories

Open WildRackoon opened this issue 2 years ago • 1 comments

Fixes two things:

  • matplotib_cpp target requires $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}> to be used with add_subdirectory so that matplotlibcpp.h can be included seamlessly
  • There are no headers within the examples subdirectory, therefore the $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/examples> is useless

WildRackoon avatar Jan 16 '23 18:01 WildRackoon

@lava can we get this one merged?

Adding $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}> also fixes the use case for including matplotlib-cpp in cmake with FetchContent:

include(FetchContent)

FetchContent_Declare(matplotlibcpp
  GIT_REPOSITORY https://github.com/lava/matplotlib-cpp.git
  GIT_TAG ef0383f1315d32e0156335e10b82e90b334f6d9f
)
FetchContent_MakeAvailable(matplotlibcpp)

plusk01 avatar Jan 28 '23 04:01 plusk01