Skip to content

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

Draft
cedrik-fuoco-adsk wants to merge 32 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 32 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 17 times, most recently from 16c3c0e to 9f12075 Compare March 30, 2026 12:50
@cedrik-fuoco-adsk cedrik-fuoco-adsk force-pushed the SG-42387-find-fork-1 branch 3 times, most recently from 1187914 to 0a7163f Compare April 1, 2026 18:03
…on MSVC)

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
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>
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>
Conan's CMakeDeps generator only sets IMPORTED_LOCATION_RELEASE /
IMPORTED_IMPLIB_RELEASE for the build_type used during conan install.
MSVC's multi-config generator validates ALL configurations in
CMAKE_CONFIGURATION_TYPES at generation time, causing errors like
"IMPORTED_LOCATION not set for ... configuration Debug" even when
only building Release.

Set CMAKE_MAP_IMPORTED_CONFIG_DEBUG, _MINSIZEREL, and
_RELWITHDEBINFO to fall back to Release properties. Gated on
RV_CONAN_CMAKE_PREFIX_PATH (Conan builds only) and
CMAKE_CONFIGURATION_TYPES (multi-config generators only).

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Conan CMakeDeps creates nested INTERFACE chains for packages with
components: e.g. libraw::libraw (INTERFACE) -> libraw::libraw_
(INTERFACE component) -> CONAN_LIB::... (real SHARED IMPORTED).

Both RV_RESOLVE_IMPORTED_LOCATION and the DEPS_LIST resolution in
rv_find_dependency.cmake only traversed one level of INTERFACE
targets, failing for packages with component wrappers.

Replace the single-level loop with a BFS traversal (depth limit 3)
and a visited set to prevent infinite loops (Imath's aggregated
target links to itself). This fixes:

- IMPORTED_LOCATION resolution for Conan component targets
- DEPS_LIST append for nested INTERFACE chains
- RV_SET_FOUND_PACKAGE_DIRS root validation (derives correct root
  from IMPORTED_LOCATION once the chain resolves)

Single-level chains (vcpkg, Homebrew) resolve on depth 0 with
identical behavior to the previous code.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Boost: build-from-source on Windows installs headers under
include/boost-<ver>/, but Conan's Boost uses include/ directly.
Guard the versioned subdirectory override with an EXISTS check so
Conan builds use the correct include path.

LibRaw: vcpkg creates libraw::raw, Conan creates libraw::libraw.
List both in DEPS_LIST_TARGETS so the correct target gets picked up
regardless of which package manager provides it.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
oiio.cmake lines 243 and 298 referenced LibRaw::raw (mixed case) in the
DEPENDS list, but raw.cmake creates libraw::raw (lowercase). CMake target
names are case-sensitive, causing 'get_property could not find TARGET
LibRaw::raw' error during configure.

Fix by using the correct lowercase libraw::raw target name to match what
raw.cmake creates.

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 2 times, most recently from 8a51fd9 to a517cab Compare April 8, 2026 18:10
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