Skip to content

feat: WIP - Implement the infrastructure to allow OpenRV to find dependencies#1210

Draft
cedrik-fuoco-adsk wants to merge 31 commits intoAcademySoftwareFoundation:mainfrom
cedrik-fuoco-adsk:SG-42387-find-fork-1
Draft

feat: WIP - Implement the infrastructure to allow OpenRV to find dependencies#1210
cedrik-fuoco-adsk wants to merge 31 commits intoAcademySoftwareFoundation:mainfrom
cedrik-fuoco-adsk:SG-42387-find-fork-1

Conversation

@cedrik-fuoco-adsk
Copy link
Copy Markdown
Contributor

Linked issues

Summarize your change.

Describe the reason for the change.

Describe what you have tested and on which operating system.

Add a list of changes, and note any that might need special attention during the review.

If possible, provide screenshots.

@cedrik-fuoco-adsk cedrik-fuoco-adsk force-pushed the SG-42387-find-fork-1 branch 3 times, most recently from e211b7f to ebaf159 Compare March 24, 2026 19:00
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
…on MSVC)

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
@cedrik-fuoco-adsk cedrik-fuoco-adsk force-pushed the SG-42387-find-fork-1 branch 10 times, most recently from 8712357 to 18088c4 Compare March 26, 2026 18:00
Add RV_FIND_DEPENDENCY macro with three-tier resolution (CONFIG,
MODULE, pkg-config), RV_STAGE_DEPENDENCY_LIBS with TARGET_LIBS for
proper incremental build tracking, and supporting infrastructure:

- RV_FIND_DEPENDENCY: unified dispatcher with version matching,
  Homebrew symlink contamination fix, and prefix tracking
- RV_STAGE_DEPENDENCY_LIBS: OUTPUT-based staging with auto-resolved
  IMPORTED_LOCATION, macOS codesign after install_name_tool, and
  SONAME symlink creation (macOS + Linux)
- rv_create_soname_symlink.cmake: cross-platform build-time script
- Plugin link race fix (ADD_DEPENDENCIES on dependencies target)
- Python3 header race fix (ADD_DEPENDENCIES on RV_DEPS_PYTHON3)
- cmake added to wheel-safe packages (pip OpenSSL 3.0+ issue)
- FFmpeg staging upgraded to TARGET_LIBS

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
libtiff is structured for find-first but forced to build from source
because OpenRV depends on private TIFF headers (tiffiop.h, tif_dir.h,
tif_hash_set.h) that system packages do not install.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
setuptools_scm 10.x introduced a breaking change that causes
"paths must be inside source tree" errors when building
setuptools-rust from source in isolated pip environments.
Since setuptools-rust is a pure Python build tool (calls cargo),
it is safe to install from wheels. cryptography continues to
build from source as before.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
setuptools_scm 10.x breaks when built from source in pip's isolated
build environments ("paths must be inside source tree"). This affects
any package whose build chain depends on setuptools_scm (cryptography
via setuptools-rust, pydantic via hatchling/pluggy, etc.).

Since setuptools_scm is a pure Python build tool (shells out to git),
it is safe to install from wheels.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
setuptools-scm 10.x depends on vcs-versioning, which needs hatchling
to build, creating a circular build tracker conflict when pip forces
source builds via --no-binary :all:. Add all pure Python build
backends/tools in the chain to the wheel-safe list: hatchling,
hatch-vcs, pluggy, pathspec, trove-classifiers, vcs-versioning.

These are build infrastructure (like setuptools and wheel) with zero
ABI dependency on the custom Python build.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Split "-G ${CMAKE_GENERATOR}" into two separate list elements so
cmake receives -G and the generator name as separate arguments.
As a single element, cmake misparses the generator name.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Prevent global vcpkg MSBuild integration (vcpkg integrate install)
from injecting vcpkg include/lib paths into Python's PCBuild.
Without this, _ctypes.pyd may link against vcpkg's libffi instead
of Python's own, causing ABI mismatches at install time.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
…_INCLUDE_DIR

Snapshot CMAKE_PREFIX_PATH before Qt adds ~150 component cmake dirs.
ExternalProject sub-builds (OIIO, OCIO) use this clean list to find
transitive dependencies without Qt noise.

Add RV_RESOLVE_IMPORTED_INCLUDE_DIR macro that follows INTERFACE
wrapper target chains (e.g. vcpkg's PNG::PNG -> PNG::png_shared)
to resolve INTERFACE_INCLUDE_DIRECTORIES. Mirrors the existing
RV_RESOLVE_IMPORTED_LINKER_FILE pattern for library files.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Replace broken STRING(REPLACE ";") escaping with initial-cache file
approach for passing CMAKE_PREFIX_PATH to ExternalProject sub-builds.
The escaped semicolons did not survive ExternalProject's double
expansion of CONFIGURE_COMMAND arguments.

Guard all -D flags with IF() to prevent -NOTFOUND values from
poisoning OIIO's own find_package searches. Use
RV_RESOLVE_IMPORTED_INCLUDE_DIR to follow INTERFACE wrapper target
chains (vcpkg creates INTERFACE wrappers like PNG::PNG around the
real PNG::png_shared target).

Fix LibRaw discovery by passing LIBRAW_LIBDIR_HINT (vcpkg puts the
import library in lib/manual-link/) and LIBRAW_INCLUDEDIR_HINT
(strip trailing /libraw since OIIO's FindLibRaw uses PATH_SUFFIXES).

Also fix OCIO Windows block which was missing CMAKE_PREFIX_PATH
propagation after _configure_options reset.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
CMAKE_IGNORE_PREFIX_PATH blocks transitive dependency discovery
(e.g. libdeflate needed by Homebrew's OpenEXR). Explicit -D flags
and -DUSE_*=0 flags are sufficient to route sub-builds to the
correct primary deps. Also revert Boost_DIR to Boost_ROOT in OIIO
since Boost_DIR only works with config mode but OIIO uses module
mode (FindBoost.cmake).

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
…gers

Add RV_EXTRACT_LINK_TARGETS helper that parses generator expressions
($<$<CONFIG:...>:target>) from INTERFACE_LINK_LIBRARIES to resolve real
target names. Add RV_COLLECT_ALL_LIBRARY_TARGETS that recursively
traverses INTERFACE chains to collect all non-INTERFACE library targets.

Integrate into all INTERFACE unwrapping sites:
- RV_RESOLVE_IMPORTED_LOCATION/INCLUDE_DIR/LINKER_FILE
- rv_stage_dependency_libs.cmake: bulk traversal via COLLECT_ALL
- rv_stage.cmake: defensive INTERFACE handling in RPATH fixup loop
- rv_find_dependency.cmake: namespaced target fallback (Package::target)
  for Conan; non-existent target guard

Add root validation to RV_SET_FOUND_PACKAGE_DIRS with REALPATH on
IMPORTED_LOCATION (macOS) to correctly validate against Cellar paths.

Signed-off-by: Clement Zhao <clement.zhao@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
When RV_CONAN_CMAKE_PREFIX_PATH is set, use CMAKE_IGNORE_PREFIX_PATH
with brew --prefix to prevent OIIO/OCIO ExternalProject sub-builds
from discovering Homebrew packages that conflict with Conan's versions.
Gated on APPLE since brew is macOS-only.

CMAKE_IGNORE_PREFIX_PATH is NOT set for Homebrew-only builds — transitive
deps like libdeflate only exist at the Homebrew prefix.

Signed-off-by: Clement Zhao <clement.zhao@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
When Conan provides OpenJPH, it creates openjph::openjph instead of
the upstream non-namespaced openjph target. Create an INTERFACE alias
so downstream code using the upstream name works transparently.

Signed-off-by: Clement Zhao <clement.zhao@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
When Conan provides LibRaw, it creates libraw::libraw instead of the
upstream pkg-config name libraw::raw. Create an INTERFACE alias so
downstream code using the upstream name works transparently.

Signed-off-by: Clement Zhao <clement.zhao@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Conan's Boost builds all components including container, system, and
wserialization which are transitively linked by Boost::thread. The
build-from-source path only builds the 15 components in _boost_libs.
Conditionally stage these extras only when the targets exist.

Signed-off-by: Clement Zhao <clement.zhao@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Add Conan 2.x support for building OpenRV with pre-built dependencies:

- openrvcore-conanfile.py: python-requires base class with dependency
  declarations and CMake toolchain generation
- conanfile.py: consuming recipe for OpenRV open-source builds
- conan/profiles/: platform profiles for macOS, Linux, Windows
- conan/README.md: build instructions and troubleshooting

Conan-managed deps: zlib, boost, imath, openexr, openssl, dav1d,
libjpeg-turbo, libpng, openjpeg, openjph, libraw, libwebp,
libatomic_ops.

Signed-off-by: Clement Zhao <clement.zhao@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant