Build: Auto clear CMake cache variables for 4.4 library update

And remove some old checks that are no longer relevant.

Pull Request: https://projects.blender.org/blender/blender/pulls/134244
This commit is contained in:
Brecht Van Lommel
2025-02-07 20:52:24 +01:00
parent fcc770390d
commit f9c4ad1477

View File

@@ -43,68 +43,6 @@ function(unset_cached_varables_containting contents msg)
endif()
endfunction()
# Detect update from 3.1 to 3.2 libs.
if(UNIX AND
DEFINED OPENEXR_VERSION AND
OPENEXR_VERSION VERSION_LESS "3.0.0" AND
EXISTS ${LIBDIR}/imath)
message(STATUS "Auto updating CMake configuration for Blender 3.2 libraries")
unset_cache_variables("^OPENIMAGEIO")
unset_cache_variables("^OPENEXR")
unset_cache_variables("^IMATH")
unset_cache_variables("^PNG")
unset_cache_variables("^USD")
unset_cache_variables("^WEBP")
unset_cache_variables("^NANOVDB")
endif()
# Automatically set WebP on/off depending if libraries are available.
if(EXISTS ${LIBDIR}/webp)
if(WITH_OPENIMAGEIO)
set(WITH_IMAGE_WEBP ON CACHE BOOL "" FORCE)
endif()
else()
set(WITH_IMAGE_WEBP OFF)
endif()
# NanoVDB moved into openvdb.
if(UNIX AND DEFINED NANOVDB_INCLUDE_DIR)
if(NOT EXISTS ${NANOVDB_INCLUDE_DIR} AND
EXISTS ${LIBDIR}/openvdb/include/nanovdb)
unset_cache_variables("^NANOVDB")
endif()
endif()
# Detect update to 3.5 libs with shared libraries.
if(UNIX AND
DEFINED TBB_LIBRARY AND
TBB_LIBRARY MATCHES "libtbb.a$" AND
EXISTS ${LIBDIR}/usd/include/pxr/base/tf/pyModule.h)
message(STATUS "Auto updating CMake configuration for Blender 3.5 libraries")
unset_cache_variables("^BLOSC")
unset_cache_variables("^BOOST")
unset_cache_variables("^Boost")
unset_cache_variables("^IMATH")
unset_cache_variables("^OPENCOLORIO")
unset_cache_variables("^OPENEXR")
unset_cache_variables("^OPENIMAGEIO")
unset_cache_variables("^OPENSUBDIV")
unset_cache_variables("^OPENVDB")
unset_cache_variables("^TBB")
unset_cache_variables("^USD")
endif()
if(UNIX AND (NOT APPLE) AND LIBDIR AND (EXISTS ${LIBDIR}))
# Only search for the path if it's found on the system.
set(_libdir_stale "/lib/linux_centos7_x86_64/")
unset_cached_varables_containting(
"${_libdir_stale}"
"Auto clearing old ${_libdir_stale} paths from CMake configuration"
)
unset(_libdir_stale)
endif()
# Detect update in 4.1 to shared library OpenImageDenoise and OSL.
if(UNIX AND
DEFINED OPENIMAGEDENOISE_LIBRARY AND
@@ -135,3 +73,26 @@ if(UNIX AND
message(STATUS "Auto updating CMake configuration for Python 3.11")
unset_cache_variables("^PYTHON_")
endif()
# Detect update to 4.4 libs.
if(LIBDIR AND
EXISTS ${LIBDIR}/tbb/include/oneapi AND
((DEFINED Boost_INCLUDE_DIR) OR (SYCL_LIBRARY MATCHES "sycl7")))
message(STATUS "Auto updating CMake configuration for Blender 4.4 libraries")
unset_cache_variables("^BOOST")
unset_cache_variables("^Boost")
unset_cache_variables("^EMBREE")
unset_cache_variables("^IMATH")
unset_cache_variables("^MATERIALX")
unset_cache_variables("^NANOVDB")
unset_cache_variables("^OPENCOLORIO")
unset_cache_variables("^OPENEXR")
unset_cache_variables("^OPENIMAGEDENOISE")
unset_cache_variables("^OPENIMAGEIO")
unset_cache_variables("^OPENVDB")
unset_cache_variables("^OSL_")
unset_cache_variables("^PYTHON")
unset_cache_variables("^SYCL")
unset_cache_variables("^TBB")
unset_cache_variables("^USD")
endif()