Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
4709ae2
build: update PCRE2 to 10.47 (fixes __builtin_mul_overflow detection …
cedrik-fuoco-adsk Mar 24, 2026
d660f5a
build: add find_package/pkg_config resolution infrastructure
cedrik-fuoco-adsk Mar 24, 2026
61d34f1
build: add dav1d find_package dispatcher
cedrik-fuoco-adsk Mar 24, 2026
a8498f9
build: add Imath find_package dispatcher
cedrik-fuoco-adsk Mar 24, 2026
24cfe00
build: add Boost find_package dispatcher
cedrik-fuoco-adsk Mar 24, 2026
2f5841b
build: add OpenEXR find_package dispatcher
cedrik-fuoco-adsk Mar 24, 2026
43d8cd4
build: add GLEW find_package dispatcher
cedrik-fuoco-adsk Mar 24, 2026
50301da
build: add zlib find_package dispatcher
cedrik-fuoco-adsk Mar 24, 2026
e2f56cd
build: add OpenSSL find_package dispatcher
cedrik-fuoco-adsk Mar 24, 2026
5d77ee2
build: fix OCIO/OIIO staging and sub-build Imath/Boost resolution
cedrik-fuoco-adsk Mar 24, 2026
943c954
build: add libpng find_package dispatcher
cedrik-fuoco-adsk Mar 25, 2026
63b8d78
build: add libtiff find_package dispatcher (force build from source)
cedrik-fuoco-adsk Mar 25, 2026
a4085f8
build: add libjpeg-turbo find_package dispatcher
cedrik-fuoco-adsk Mar 25, 2026
2856948
build: add LibRaw find_package dispatcher
cedrik-fuoco-adsk Mar 25, 2026
910e27a
build: add OpenJPEG find_package dispatcher
cedrik-fuoco-adsk Mar 25, 2026
7fe2a83
build: add OpenJPH find_package dispatcher
cedrik-fuoco-adsk Mar 25, 2026
be0d953
build: disable vcpkg MSBuild integration during Python build
cedrik-fuoco-adsk Mar 27, 2026
759f51c
build: add RV_DEPS_CMAKE_PREFIX_PATH snapshot and RV_RESOLVE_IMPORTED…
cedrik-fuoco-adsk Mar 27, 2026
cd926b2
build: fix OIIO/OCIO ExternalProject sub-build dependency discovery
cedrik-fuoco-adsk Mar 27, 2026
68f7e4e
build: disable CMAKE_IGNORE_PREFIX_PATH in OIIO/OCIO sub-builds
cedrik-fuoco-adsk Mar 27, 2026
84d6c19
build: add generic INTERFACE IMPORTED target support for package mana…
cedrik-fuoco-adsk Mar 30, 2026
446adc9
build: block Homebrew prefix in OIIO/OCIO sub-builds when using Conan
cedrik-fuoco-adsk Mar 30, 2026
65175f7
build: handle Conan namespaced target for OpenJPH found path
cedrik-fuoco-adsk Mar 30, 2026
c1c5f4c
build: handle Conan namespaced target for LibRaw found path
cedrik-fuoco-adsk Mar 30, 2026
4aa282a
build: stage transitive Boost components from package managers
cedrik-fuoco-adsk Mar 30, 2026
146c83a
build: add Conan package manager integration
cedrik-fuoco-adsk Mar 30, 2026
70261a2
build: map non-Release configs to Release for Conan on MSVC
cedrik-fuoco-adsk Mar 31, 2026
7b9c175
build: traverse nested INTERFACE chains in imported target resolution
cedrik-fuoco-adsk Mar 31, 2026
624daf4
build: fix Boost include path and LibRaw target for Conan on Windows
cedrik-fuoco-adsk Mar 31, 2026
a565529
build: Fix an oddly new issue with python.h and ocio
cedrik-fuoco-adsk Apr 1, 2026
c8158c2
build: fix libraw target name in OIIO ExternalProject DEPENDS
cedrik-fuoco-adsk Apr 8, 2026
06afd6a
Conan CI
cedrik-fuoco-adsk Apr 8, 2026
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
833 changes: 833 additions & 0 deletions .github/workflows/conan.yml

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions cmake/defaults/CYCOMMON.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ SET(RV_DEPS_ATOMIC_OPS_DOWNLOAD_HASH

# dav1d https://github.com/videolan/dav1d
SET(RV_DEPS_DAV1D_VERSION
"1.4.3"
"1.5.3"
)
SET(RV_DEPS_DAV1D_DOWNLOAD_HASH
"2c62106fda87a69122dc8709243a34e8"
"6a195752588586acf13349a1cceedab8"
)
SET(RV_DEPS_DAV1D_VERSION_LIB
"7"
)

# doctest https://github.com/doctest/doctest
Expand Down Expand Up @@ -205,10 +208,10 @@ SET(RV_DEPS_OTIO_VERSION

# pcre2 https://github.com/PCRE2Project/pcre2
SET(RV_DEPS_PCRE2_VERSION
"10.43"
"10.47"
)
SET(RV_DEPS_PCRE2_DOWNLOAD_HASH
"e4c3f2a24eb5c15bec8360e50b3f0137"
"9a77e2cdc4410addf9a77363a89fe858"
)

# png https://github.com/glennrp/libpng
Expand Down
26 changes: 26 additions & 0 deletions cmake/defaults/rv_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,29 @@ SET_PROPERTY(
CACHE RV_FFMPEG
PROPERTY STRINGS ${_RV_FFMPEG}
)

#
# Dependency resolution option
#
# When ON, try find_package() for each dependency before building from source. When OFF (default), always build dependencies from source (current behavior).
#
# Per-dependency override: set RV_DEPS_<NAME>_FORCE_BUILD=ON to force building a specific dependency from source even when RV_DEPS_PREFER_INSTALLED=ON.
#
OPTION(RV_DEPS_PREFER_INSTALLED "Try find_package() for dependencies before building from source" OFF)

#
# Version matching mode for dependency resolution.
#
# Controls how RV_FIND_DEPENDENCY matches versions when RV_DEPS_PREFER_INSTALLED=ON. EXACT — require the exact version specified in CY*.cmake (default,
# recommended) MINIMUM — accept the specified version or newer (standard find_package behavior)
#
# Per-dependency override: set RV_DEPS_<NAME>_VERSION_MATCH=EXACT or MINIMUM to override the global setting for a specific dependency.
#
SET(RV_DEPS_VERSION_MATCH
"EXACT"
CACHE STRING "Version matching mode for find_package: EXACT or MINIMUM"
)
SET_PROPERTY(
CACHE RV_DEPS_VERSION_MATCH
PROPERTY STRINGS EXACT MINIMUM
)
31 changes: 31 additions & 0 deletions cmake/dependencies/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,37 @@ INCLUDE(rv_create_std_deps_vars)
INCLUDE(rv_make_std_lib_name)
INCLUDE(rv_stage_dependency_libs)
INCLUDE(rv_add_imported_library)
INCLUDE(rv_find_dependency)

# All imported targets created by find_package() are automatically GLOBAL, so subdirectories can reference them without manual promotion.
SET(CMAKE_FIND_PACKAGE_TARGETS_GLOBAL
TRUE
)

# When Conan provides single-config (Release-only) targets on a multi-config generator (MSVC), map non-Release configurations to Release so that
# IMPORTED_LOCATION_RELEASE / IMPORTED_IMPLIB_RELEASE are used for validation. Without this, CMake errors with "IMPORTED_LOCATION not set for imported target
# ... configuration Debug" because multi-config generators validate ALL configurations in CMAKE_CONFIGURATION_TYPES at generation time, but Conan's CMakeDeps
# only sets properties for the build_type used during `conan install`.
IF(RV_CONAN_CMAKE_PREFIX_PATH
AND MSVC
)
SET(CMAKE_MAP_IMPORTED_CONFIG_DEBUG
Release RelWithDebInfo ""
)
SET(CMAKE_MAP_IMPORTED_CONFIG_MINSIZEREL
Release RelWithDebInfo ""
)
SET(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO
Release ""
)
ENDIF()

# Snapshot the user's CMAKE_PREFIX_PATH before Qt adds ~150 component cmake dirs. ExternalProject sub-builds (OIIO, OCIO, OpenEXR) use this clean list to find
# transitive dependencies without Qt noise.
SET(RV_DEPS_CMAKE_PREFIX_PATH
"${CMAKE_PREFIX_PATH}"
CACHE INTERNAL "User's CMAKE_PREFIX_PATH before Qt additions"
)

INCLUDE(ProcessorCount)
PROCESSORCOUNT(_cpu_count)
Expand Down
256 changes: 109 additions & 147 deletions cmake/dependencies/boost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,10 @@ SET(_ext_boost_version
SET(_major_minor_version
${RV_DEPS_BOOST_MAJOR_MINOR_VERSION}
)
SET(_download_hash
${RV_DEPS_BOOST_DOWNLOAD_HASH}
)

RV_CREATE_STANDARD_DEPS_VARIABLES("RV_DEPS_BOOST" "${_ext_boost_version}" "" "")
RV_CREATE_STANDARD_DEPS_VARIABLES("RV_DEPS_BOOST" "${_ext_boost_version}" "" "" FORCE_LIB)
RV_SHOW_STANDARD_DEPS_VARIABLES()

STRING(REPLACE "." "_" _version_with_underscore ${_version})
SET(_download_url
"https://archives.boost.io/release/${_version}/source/boost_${_version_with_underscore}.tar.gz"
)

SET(_boost_libs
atomic
chrono
Expand All @@ -44,10 +36,32 @@ SET(_boost_libs
timer
)

SET(_lib_dir
${_install_dir}/lib
# Build DEPS_LIST_TARGETS from _boost_libs
SET(_boost_deps_list_targets
""
)
FOREACH(
_boost_lib
${_boost_libs}
)
LIST(APPEND _boost_deps_list_targets Boost::${_boost_lib})
ENDFOREACH()

# --- Try to find installed package ---
RV_FIND_DEPENDENCY(
TARGET
${_target}
PACKAGE
Boost
VERSION
${_ext_boost_version}
COMPONENTS
${_boost_libs}
DEPS_LIST_TARGETS
${_boost_deps_list_targets}
)

# --- Library naming (shared between find and build paths) ---
# Note: Boost has a custom lib naming scheme on windows
IF(RV_TARGET_WINDOWS)
SET(BOOST_SHARED_LIBRARY_PREFIX
Expand Down Expand Up @@ -80,6 +94,7 @@ ELSE()
)
ENDIF()

# Compute per-lib paths AFTER RV_FIND_DEPENDENCY (which may override _lib_dir)
FOREACH(
_boost_lib
${_boost_libs}
Expand All @@ -99,149 +114,96 @@ FOREACH(
ENDIF()
ENDFOREACH()

LIST(APPEND _boost_b2_options "-s")
LIST(APPEND _boost_b2_options "NO_LZMA=1")
# --- Build from source if not found ---
IF(NOT ${_target}_FOUND)
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/build/boost.cmake)

IF(RV_VERBOSE_INVOCATION)
LIST(APPEND _boost_b2_options "-d+2")
ELSE()
LIST(APPEND _boost_b2_options "-d+0")
ENDIF()

IF(RV_TARGET_DARWIN)
SET(_toolset
"clang"
)

ELSEIF(RV_TARGET_LINUX)
SET(_toolset
"gcc"
)
ELSEIF(RV_TARGET_WINDOWS)
SET(_toolset
"msvc-14.3"
# Build path: we control the filenames, use OUTPUTS for precise tracking
FOREACH(
_boost_lib
${_boost_libs}
)
ELSE()
MESSAGE(FATAL_ERROR "Unsupported (yet) target for Boost")
ENDIF()

SET(_b2_command
./b2
)

IF(RV_TARGET_WINDOWS)
SET(_bootstrap_command
./bootstrap.bat
)
ELSE()
SET(_bootstrap_command
./bootstrap.sh
)
ENDIF()

IF(RV_TARGET_WINDOWS)
SET(_boost_python_bin
${RV_DEPS_BASE_DIR}/RV_DEPS_PYTHON3/install/python.exe
)
ELSE()
SET(_boost_python_bin
${RV_DEPS_BASE_DIR}/RV_DEPS_PYTHON3/install/bin/python
)
ENDIF()

STRING(TOLOWER ${CMAKE_BUILD_TYPE} _boost_variant)

LIST(
TRANSFORM _boost_libs
PREPEND "--with-"
OUTPUT_VARIABLE _boost_with_list
)

SET(__boost_arch__
x86
)
IF(APPLE)
IF(RV_TARGET_APPLE_ARM64)
SET(__boost_arch__
arm
)
LIST(APPEND _boost_stage_output ${RV_STAGE_LIB_DIR}/${_boost_${_boost_lib}_lib_name})
ENDFOREACH()
# Note: On Windows, Boost's b2 puts both .lib and .dll in lib/, so we copy _lib_dir to both RV_STAGE_LIB_DIR and RV_STAGE_BIN_DIR.
IF(RV_TARGET_WINDOWS)
RV_STAGE_DEPENDENCY_LIBS(TARGET ${_target} EXTRA_LIB_DIRS ${RV_STAGE_BIN_DIR} OUTPUTS ${_boost_stage_output})
ELSE()
RV_STAGE_DEPENDENCY_LIBS(TARGET ${_target} OUTPUTS ${_boost_stage_output})
ENDIF()
ENDIF()

EXTERNALPROJECT_ADD(
${_target}
DEPENDS Python::Python
DOWNLOAD_NAME ${_target}_${_version}.tar.gz
DOWNLOAD_DIR ${RV_DEPS_DOWNLOAD_DIR}
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
SOURCE_DIR ${RV_DEPS_BASE_DIR}/${_target}/src
INSTALL_DIR ${_install_dir}
URL ${_download_url}
URL_MD5 ${_download_hash}
CONFIGURE_COMMAND ${_bootstrap_command} --with-toolset=${_toolset} --with-python=${_boost_python_bin}
BUILD_COMMAND
# Ref.: https://www.boost.org/doc/libs/1_70_0/tools/build/doc/html/index.html#bbv2.builtin.features.cflags Ref.:
# https://www.boost.org/doc/libs/1_76_0/tools/build/doc/html/index.html#bbv2.builtin.features.cflags
./b2 -a -q toolset=${_toolset} cxxstd=${RV_CPP_STANDARD} variant=${_boost_variant} link=shared threading=multi architecture=${__boost_arch__}
address-model=64 ${_boost_with_list} ${_boost_b2_options} -j${_cpu_count} install --prefix=${_install_dir}
INSTALL_COMMAND echo "Boost was both built and installed in the build stage"
BUILD_IN_SOURCE TRUE
BUILD_ALWAYS FALSE
BUILD_BYPRODUCTS ${_boost_byproducts}
USES_TERMINAL_BUILD TRUE
)

IF(RV_TARGET_WINDOWS)
SET(_include_dir
${_install_dir}/include/boost-${_major_minor_version}
)
ELSE()
SET(_include_dir
${_install_dir}/include
)
ENDIF()

FILE(MAKE_DIRECTORY ${_include_dir})

FOREACH(
_boost_lib
${_boost_libs}
)
ADD_LIBRARY(Boost::${_boost_lib} SHARED IMPORTED GLOBAL)
ADD_DEPENDENCIES(Boost::${_boost_lib} ${_target})
SET_PROPERTY(
TARGET Boost::${_boost_lib}
PROPERTY IMPORTED_LOCATION ${_boost_${_boost_lib}_lib}
)
SET_PROPERTY(
TARGET Boost::${_boost_lib}
PROPERTY IMPORTED_SONAME ${_boost_${_boost_lib}_lib_name}
)

# CONFIG found — Boost::xxx targets already exist with proper LOCATION. Create any missing targets as a safety net.
IF(RV_TARGET_WINDOWS)
SET_PROPERTY(
TARGET Boost::${_boost_lib}
PROPERTY IMPORTED_IMPLIB ${_boost_${_boost_lib}_implib}
# Build-from-source Boost on Windows installs headers under include/boost-<ver>/. Conan's Boost uses include/ directly. Only apply the versioned
# subdirectory when it actually exists.
SET(_boost_versioned_include
${_install_dir}/include/boost-${_major_minor_version}
)
IF(EXISTS "${_boost_versioned_include}")
SET(_include_dir
${_boost_versioned_include}
)
ENDIF()
ENDIF()
TARGET_INCLUDE_DIRECTORIES(
Boost::${_boost_lib}
INTERFACE ${_include_dir}
)

LIST(APPEND RV_DEPS_LIST Boost::${_boost_lib})
LIST(APPEND _boost_stage_output ${RV_STAGE_LIB_DIR}/${_boost_${_boost_lib}_lib_name})
ENDFOREACH()

ADD_LIBRARY(Boost::headers INTERFACE IMPORTED GLOBAL)
SET_TARGET_PROPERTIES(
Boost::headers
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${_include_dir}"
)
# Boost::headers is not in DEPS_LIST_TARGETS so the general symlink fixup in RV_FIND_DEPENDENCY doesn't reach it. Fix it here: Boost's config has a symlink
# resolution bug where get_filename_component(REALPATH) on "../" normalizes before resolving, landing on the shared prefix include dir (e.g.
# /opt/homebrew/include) instead of the package-specific one.
IF(TARGET Boost::headers)
GET_TARGET_PROPERTY(_boost_headers_inc Boost::headers INTERFACE_INCLUDE_DIRECTORIES)
IF(_boost_headers_inc
AND NOT "${_boost_headers_inc}" STREQUAL "${_include_dir}"
)
SET_TARGET_PROPERTIES(
Boost::headers
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${_include_dir}"
)
MESSAGE(STATUS " Fixed Boost::headers include: ${_boost_headers_inc} -> ${_include_dir}")
ENDIF()
ELSE()
ADD_LIBRARY(Boost::headers INTERFACE IMPORTED GLOBAL)
SET_TARGET_PROPERTIES(
Boost::headers
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${_include_dir}"
)
ENDIF()

# Note: On Windows, Boost's b2 puts both .lib and .dll in lib/, so we copy _lib_dir to both RV_STAGE_LIB_DIR and RV_STAGE_BIN_DIR.
IF(RV_TARGET_WINDOWS)
RV_STAGE_DEPENDENCY_LIBS(TARGET ${_target} EXTRA_LIB_DIRS ${RV_STAGE_BIN_DIR} OUTPUTS ${_boost_stage_output})
ELSE()
RV_STAGE_DEPENDENCY_LIBS(TARGET ${_target} OUTPUTS ${_boost_stage_output})
FOREACH(
_boost_lib
${_boost_libs}
)
IF(NOT TARGET Boost::${_boost_lib})
RV_ADD_IMPORTED_LIBRARY(
NAME
Boost::${_boost_lib}
TYPE
SHARED
LOCATION
${_boost_${_boost_lib}_lib}
SONAME
${_boost_${_boost_lib}_lib_name}
IMPLIB
${_boost_${_boost_lib}_implib}
INCLUDE_DIRS
${_include_dir}
DEPENDS
${_target}
)
ENDIF()
ENDFOREACH()

# Found path: actual filenames may differ (e.g. -mt suffix), use TARGET_LIBS to resolve at build time. Also stage transitive Boost components that a package
# manager (Conan) provides but aren't in _boost_libs (the source build doesn't build these).
SET(_boost_stage_targets
${_boost_deps_list_targets}
)
FOREACH(
_boost_extra
container system wserialization
)
IF(TARGET Boost::${_boost_extra})
LIST(APPEND _boost_stage_targets Boost::${_boost_extra})
ENDIF()
ENDFOREACH()
RV_STAGE_DEPENDENCY_LIBS(TARGET ${_target} TARGET_LIBS ${_boost_stage_targets})
ENDIF()
Loading
Loading