AcademySoftwareFoundation / OpenColorIO

A color management framework for visual effects and animation.
https://opencolorio.org
BSD 3-Clause "New" or "Revised" License
1.76k stars 434 forks source link

Broken yaml 0.8.0 detection. #1858

Closed SlawekNowy closed 9 months ago

SlawekNowy commented 11 months ago

The EndeavourOS (flavour of ArchLinux) package of yaml-cpp has no yaml-cpp target, only yaml-cpp::yaml-cpp

The config file is located and read from properly.

[slawomir@slawomir-hppavilionlaptop15cc5xx build]$ cmake ..
-- The CXX compiler identification is GNU 13.2.1
-- The C compiler identification is GNU 13.2.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Setting build type to 'Release' as none was specified.
-- Setting C++ version to '14' as none was specified.
-- Performing Test COMPILER_SUPPORTS_CXX14
-- Performing Test COMPILER_SUPPORTS_CXX14 - Success
-- 
-- Checking for GPU configuration...
-- Found OpenGL (no version information)
-- Found GLEW (version "2.2.0")
-- Found GLUT (no version information)
-- GLVND supported
-- Performing Test COMPILER_SUPPORTS_ARM_NEON
-- Performing Test COMPILER_SUPPORTS_ARM_NEON - Failed
-- Performing Test COMPILER_SUPPORTS_AVX
-- Performing Test COMPILER_SUPPORTS_AVX - Success
-- Performing Test COMPILER_SUPPORTS_AVX2
-- Performing Test COMPILER_SUPPORTS_AVX2 - Success
-- Performing Test COMPILER_SUPPORTS_AVX512
-- Performing Test COMPILER_SUPPORTS_AVX512 - Success
-- Performing Test COMPILER_SUPPORTS_SSE42
-- Performing Test COMPILER_SUPPORTS_SSE42 - Success
-- Performing Test COMPILER_SUPPORTS_SSE4
-- Performing Test COMPILER_SUPPORTS_SSE4 - Success
-- Performing Test COMPILER_SUPPORTS_SSSE3
-- Performing Test COMPILER_SUPPORTS_SSSE3 - Failed
-- Performing Test COMPILER_SUPPORTS_SSE3
-- Performing Test COMPILER_SUPPORTS_SSE3 - Success
-- Performing Test COMPILER_SUPPORTS_SSE2
-- Performing Test COMPILER_SUPPORTS_SSE2 - Success
-- Performing Test COMPILER_SUPPORTS_F16C
-- Performing Test COMPILER_SUPPORTS_F16C - Success
-- OCIO_USE_SSSE3 requested but compiler does not support, disabling
-- Setting SOVERSION to '2.3' as none was specified.
-- 
-- Missing a dependency? Try the following possibilities:
-- If the package provides CMake's configuration file, use -D<pkg>_DIR=<path to folder>.
-- If it doesn't provide it, try -D<pkg>_ROOT=<path to folder with lib and includes>.
-- Alternatively, try -D<pkg>_LIBRARY=<path to lib file> and/or -D<pkg>_INCLUDE_DIR=<path to folder>.
-- 
-- Please refer to the find module under share/cmake/modules for extra information.
-- 
-- Checking for mandatory dependencies...
-- Found expat (version "2.5.0")
CMake Error at share/cmake/modules/Findyaml-cpp.cmake:53 (get_target_property):
  get_target_property() called with non-existent target "yaml-cpp".
Call Stack (most recent call first):
  share/cmake/macros/ocio_handle_dependency.cmake:114 (find_package)
  share/cmake/modules/FindExtPackages.cmake:64 (ocio_handle_dependency)
  CMakeLists.txt:449 (include)

CMake Error at share/cmake/modules/Findyaml-cpp.cmake:53 (get_target_property):
  get_target_property() called with non-existent target "yaml-cpp".
Call Stack (most recent call first):
  share/cmake/macros/ocio_handle_dependency.cmake:138 (find_package)
  share/cmake/modules/FindExtPackages.cmake:64 (ocio_handle_dependency)
  CMakeLists.txt:449 (include)

-- Could NOT find yaml-cpp (minimum version: "0.6.3", recommended version: "0.7.0")
-- Installed yaml-cpp (version "0.7.0")
-- Found pystring (no version information)
-- Found Imath (version "3.1.9")
-- Found ZLIB (version "1.3")
-- Found minizip-ng (version "4.0.1")
-- 
-- Checking for optional dependencies...
-- Found lcms2 (version "2.15")
-- Found Python (version "3.11.5")
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- Found pybind11 (version "2.11.1")
-- Checking if the OpenImageIO found is built with OpenEXR 3+...
-- Found OpenImageIO (version "2.4.12.0")
-- Found OpenEXR (version "3.2.0")
-- Using OpenEXR to build ociolutimage, ocioconvert and ociodisplay.
-- Found OSL (version "1.12.13.0")
CMake Warning at src/bindings/python/CMakeLists.txt:44 (message):
  Building PyOpenColorIO with OCIO_BUILD_DOCS disabled will result in
  incomplete Python docstrings.

-- Configuring incomplete, errors occurred!
[slawomir@slawomir-hppavilionlaptop15cc5xx build]$ 
listout commented 11 months ago

Can confirm

berndf commented 11 months ago

I'm seeing the same error on gentoo with opencolorio 2.3.0 and yaml-cpp. As far as I can see, opencolorio 2.3.0 already includes patch https://github.com/AcademySoftwareFoundation/OpenColorIO/pull/1823 and an additional small patch is needed (cf https://bugs.gentoo.org/914716). Could anybody confirm?

SlawekNowy commented 11 months ago

In my case it still proved insufficient. ~Only aliasing the needed target worked.~

EDIT: I likely have found defect in a patch. We should be writing to yaml-cpp_LIBRARY not yaml-cpp::yaml-cpp_LIBRARY, as the former variable is later used to define our target.

Got another error though

CMake Error at share/cmake/modules/Findyaml-cpp.cmake:157 (set_target_properties):
  set_target_properties called with incorrect number of arguments.
Call Stack (most recent call first):
  share/cmake/macros/ocio_handle_dependency.cmake:114 (find_package)
  share/cmake/modules/FindExtPackages.cmake:64 (ocio_handle_dependency)
  CMakeLists.txt:449 (include)
SlawekNowy commented 11 months ago

Huh. Apparently we need to export includes too as otherwise that set_target_properties would be called with 5 arguments.

SlawekNowy commented 11 months ago

Here's the revised patch. yaml-cpp.patch.tar.gz

remia commented 11 months ago

Thanks for the report and fix @SlawekNowy! Would you mind opening a PR for that if you have the time?

doug-walker commented 9 months ago

Should be fixed by PR #1891. Please re-open if that's not the case.