From aa4d263c7f435d7ca89d96d70a978cd32ae388e7 Mon Sep 17 00:00:00 2001 From: SlawekNowy <38943477+SlawekNowy@users.noreply.github.com> Date: Fri, 6 Oct 2023 11:37:35 +0200 Subject: [PATCH 1/2] Full fix for broken yaml Signed-off-by: SlawekNowy <38943477+SlawekNowy@users.noreply.github.com> --- share/cmake/modules/Findyaml-cpp.cmake | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/share/cmake/modules/Findyaml-cpp.cmake b/share/cmake/modules/Findyaml-cpp.cmake index 5a850f9601..d8d92acab7 100644 --- a/share/cmake/modules/Findyaml-cpp.cmake +++ b/share/cmake/modules/Findyaml-cpp.cmake @@ -43,14 +43,21 @@ endif() if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL) set(_yaml-cpp_REQUIRED_VARS yaml-cpp_LIBRARY) - if(NOT DEFINED yaml-cpp_ROOT) # Search for yaml-cpp-config.cmake find_package(yaml-cpp ${yaml-cpp_FIND_VERSION} CONFIG QUIET) endif() if(yaml-cpp_FOUND) - get_target_property(yaml-cpp_LIBRARY yaml-cpp LOCATION) + if(TARGET yaml-cpp::yaml-cpp) + # yaml-cpp >= 0.8 + get_target_property(yaml-cpp_LIBRARY yaml-cpp::yaml-cpp LOCATION) + get_target_property(yaml-cpp_INCLUDE_DIR yaml-cpp::yaml-cpp INCLUDE_DIRECTORIES) + else() + + get_target_property(yaml-cpp_LIBRARY yaml-cpp LOCATION) + get_target_property(yaml-cpp_INCLUDE_DIR yaml-cpp INCLUDE_DIRECTORIES) + endif() else() # As yaml-cpp-config.cmake search fails, search an installed library From c67164ea74fae560354781c191beea1ad9668d2b Mon Sep 17 00:00:00 2001 From: SlawekNowy <38943477+SlawekNowy@users.noreply.github.com> Date: Sat, 28 Oct 2023 12:13:11 +0200 Subject: [PATCH 2/2] Fixed inconsistent indents --- share/cmake/modules/Findyaml-cpp.cmake | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/share/cmake/modules/Findyaml-cpp.cmake b/share/cmake/modules/Findyaml-cpp.cmake index d8d92acab7..1ae3a7a549 100644 --- a/share/cmake/modules/Findyaml-cpp.cmake +++ b/share/cmake/modules/Findyaml-cpp.cmake @@ -50,14 +50,13 @@ if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL) if(yaml-cpp_FOUND) if(TARGET yaml-cpp::yaml-cpp) - # yaml-cpp >= 0.8 - get_target_property(yaml-cpp_LIBRARY yaml-cpp::yaml-cpp LOCATION) - get_target_property(yaml-cpp_INCLUDE_DIR yaml-cpp::yaml-cpp INCLUDE_DIRECTORIES) - else() - - get_target_property(yaml-cpp_LIBRARY yaml-cpp LOCATION) - get_target_property(yaml-cpp_INCLUDE_DIR yaml-cpp INCLUDE_DIRECTORIES) - endif() + # yaml-cpp >= 0.8 + get_target_property(yaml-cpp_LIBRARY yaml-cpp::yaml-cpp LOCATION) + get_target_property(yaml-cpp_INCLUDE_DIR yaml-cpp::yaml-cpp INCLUDE_DIRECTORIES) + else() + get_target_property(yaml-cpp_LIBRARY yaml-cpp LOCATION) + get_target_property(yaml-cpp_INCLUDE_DIR yaml-cpp INCLUDE_DIRECTORIES) + endif() else() # As yaml-cpp-config.cmake search fails, search an installed library