Skip to content
Closed
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
10 changes: 8 additions & 2 deletions share/cmake/modules/Findyaml-cpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,20 @@ 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)
Comment thread
MrSoup678 marked this conversation as resolved.
# 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
Expand Down