From 9cd8e625ced55eec456404094e90a89214a56a44 Mon Sep 17 00:00:00 2001 From: Vicente Adolfo Bolea Sanchez Date: Mon, 11 Sep 2023 18:50:39 -0400 Subject: [PATCH] yaml-cpp: support 0.8.0 version --- thirdparty/CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 72646b85e9..c184d74d24 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -71,12 +71,20 @@ add_subdirectory(nlohmann_json) adios2_add_thirdparty_target(nlohmann_json nlohmann_json_wrapper) if(ADIOS2_USE_EXTERNAL_YAMLCPP) - find_package(yaml-cpp REQUIRED) + find_package(yaml-cpp 0.7.0 REQUIRED) else() add_subdirectory(yaml-cpp) endif() + adios2_add_thirdparty_target(yaml-cpp yaml-cpp) +# YAML-cpp does not add the incdir/libdir to its target rather it exposes it +# through the cmake variables YAML_CPP_INCLUDE_DIR and YAML_CPP_LIBRARY_DIR +if(yaml-cpp_VERSION VERSION_GREATER_EQUAL 0.8) + target_include_directories(adios2::thirdparty::yaml-cpp INTERFACE ${YAML_CPP_INCLUDE_DIR}) + target_link_directories(adios2::thirdparty::yaml-cpp INTERFACE ${YAML_CPP_LIBRARY_DIR}) +endif() + if(WIN32) add_subdirectory(mingw-w64) endif()