CMake: Disable Options Depending on OpenEXR Dependecies #106209

Merged
Jeroen Bakker merged 3 commits from Jeroen-Bakker/blender:cmake-imath-libraries into main 2023-04-03 09:51:02 +02:00
2 changed files with 4 additions and 3 deletions
Showing only changes of commit 04956a01bd - Show all commits

View File

@ -953,6 +953,7 @@ if(WITH_CYCLES_DEVICE_HIP)
set(WITH_HIP_DYNLOAD ON)
endif()
# -----------------------------------------------------------------------------
# Check if Sub-modules are Cloned
@ -1234,6 +1235,7 @@ if(WITH_METAL_BACKEND)
# build_files/cmake/platform/platform_apple.cmake
endif()
# -----------------------------------------------------------------------------
# Configure OpenMP

View File

@ -120,8 +120,8 @@ UNSET(_openexr_libs_ver)
IF(OPENEXR_VERSION VERSION_GREATER_EQUAL "3.0.0")
# For OpenEXR 3.x, we also need to find the now separate Imath library.
# For simplicity we also add it to the OpenEXR includes and libraries, as it's simpler to
# support both 2.x and 3.x this way.
# For simplicity we also add it to the OpenEXR includes and libraries,
# as it's simpler to support both 2.x and 3.x this way.
Jeroen-Bakker marked this conversation as resolved Outdated

This code only runs for OpenEXR 3, so this does not work for 2. To handle both cases:

IF(OPENEXR_VERSION VERSION_GREATER_EQUAL "3.0.0")
	set(IMATH_LIBRARIES ${IMATH_LIBRARY})
ELSE()
	set(IMATH_LIBRARIES ${OPENEXR_IMATH_LIBRARY})
ENDIF()
This code only runs for OpenEXR 3, so this does not work for 2. To handle both cases: ``` IF(OPENEXR_VERSION VERSION_GREATER_EQUAL "3.0.0") set(IMATH_LIBRARIES ${IMATH_LIBRARY}) ELSE() set(IMATH_LIBRARIES ${OPENEXR_IMATH_LIBRARY}) ENDIF() ```
# Find include directory
FIND_PATH(IMATH_INCLUDE_DIR
@ -174,7 +174,6 @@ ELSE()
SET(IMATH_LIBRARIES ${OPENEXR_IMATH_LIBRARY})
ENDIF()
# handle the QUIETLY and REQUIRED arguments and set OPENEXR_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)