Skip to content

Commit

Permalink
build(deps): add yaml-cpp build recipe
Browse files Browse the repository at this point in the history
It's an OCIO dependency.
  • Loading branch information
zachlewis committed Aug 30, 2024
1 parent 425244a commit 496e6a3
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
41 changes: 41 additions & 0 deletions src/cmake/build_yaml-cpp.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright Contributors to the OpenImageIO project.
# SPDX-License-Identifier: Apache-2.0
# https://github.com/AcademySoftwareFoundation/OpenImageIO

######################################################################
# yaml-cpp by hand!
######################################################################

set_cache (yaml-cpp_BUILD_VERSION 0.8.0 "yaml-cpp version for local builds")
set (yaml-cpp_GIT_REPOSITORY "https://github.com/jbeder/yaml-cpp")
set (yaml-cpp_GIT_TAG "${yaml-cpp_BUILD_VERSION}") # NB: versions earlier than 0.8.0 had a "yaml-cpp-" prefix

set_cache (yaml-cpp_BUILD_SHARED_LIBS ${LOCAL_BUILD_SHARED_LIBS_DEFAULT}
DOC "Should a local yaml-cpp build, if necessary, build shared libraries" ADVANCED)

string (MAKE_C_IDENTIFIER ${yaml-cpp_BUILD_VERSION} yaml-cpp_VERSION_IDENT)

build_dependency_with_cmake(yaml-cpp
VERSION ${yaml-cpp_BUILD_VERSION}
GIT_REPOSITORY ${yaml-cpp_GIT_REPOSITORY}
GIT_TAG ${yaml-cpp_GIT_TAG}
CMAKE_ARGS
-D YAML_CPP_BUILD_TESTS=OFF
-D YAML_CPP_BUILD_TOOLS=OFF
-D YAML_CPP_BUILD_CONTRIB=OFF
-D YAML_BUILD_SHARED_LIBS=${yaml-cpp_BUILD_SHARED_LIBS}
-D CMAKE_INSTALL_LIBDIR=lib
)

set (yaml-cpp_ROOT ${yaml-cpp_LOCAL_INSTALL_DIR})
set (yaml-cpp_DIR ${yaml-cpp_LOCAL_INSTALL_DIR})
set (yaml-cpp_VERSION ${yaml-cpp_BUILD_VERSION})

set (yaml-cpp_REFIND TRUE)
set (yaml-cpp_REFIND_ARGS CONFIG)
set (yaml-cpp_REFIND_VERSION ${yaml-cpp_BUILD_VERSION})


if (yaml-cpp_BUILD_SHARED_LIBS)
install_local_dependency_libs (yaml-cpp yaml-cpp)
endif ()
8 changes: 6 additions & 2 deletions src/cmake/externalpackages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,12 @@ checked_find_package (Freetype
VERSION_MIN 2.10.0
DEFINITIONS USE_FREETYPE=1 )

checked_find_package (OpenColorIO
VERSION_MIN 1.1

checked_find_package (yaml-cpp
VERSION_MIN 0.6.0 ) # Used by OpenColorIO

checked_find_package (OpenColorIO REQUIRED
VERSION_MIN 2.2
VERSION_MAX 2.9
NO_FP_RANGE_CHECK
DEFINITIONS USE_OCIO=1 USE_OPENCOLORIO=1
Expand Down

0 comments on commit 496e6a3

Please sign in to comment.