Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support yaml-cpp >= 0.8.0 #46

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions yaml_cpp_vendor-extras.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ find_package(yaml-cpp REQUIRED)
set(yaml_cpp_vendor_LIBRARIES ${YAML_CPP_LIBRARIES})
set(yaml_cpp_vendor_INCLUDE_DIRS ${YAML_CPP_INCLUDE_DIR})

list(APPEND yaml_cpp_vendor_TARGETS yaml-cpp)
if(WIN32)
# On Windows, yaml-cpp 0.7.0 requires that downstream consumers set YAML_CPP_DLL and
# not yaml_cpp_EXPORT in order to set dllimport properly.
# This behavior will likely change in future versions of yaml-cpp.
set_target_properties(yaml-cpp PROPERTIES INTERFACE_COMPILE_DEFINITIONS YAML_CPP_DLL)
# since yaml-cpp 0.8.0, yaml-cpp supports the yaml-cpp::yaml-cpp target
if(TARGET yaml-cpp::yaml-cpp)
list(APPEND yaml_cpp_vendor_TARGETS yaml-cpp::yaml-cpp)
else()
list(APPEND yaml_cpp_vendor_TARGETS yaml-cpp)
if(WIN32)
# On Windows, yaml-cpp 0.7.0 requires that downstream consumers set YAML_CPP_DLL and
# not yaml_cpp_EXPORT in order to set dllimport properly.
# This behavior will likely change in future versions of yaml-cpp.
set_target_properties(yaml-cpp PROPERTIES INTERFACE_COMPILE_DEFINITIONS YAML_CPP_DLL)
endif()
endif()