From bbc158773cf6dfb4f5f05df6b8d4d7d0b03899a1 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Mon, 30 Mar 2026 11:10:02 +0200 Subject: [PATCH 1/2] [cmake] Do not require png,gif,jpeg if asimage is OFF Follow-up of https://github.com/root-project/root/pull/21688#issuecomment-4153134300 --- cmake/modules/SearchInstalledSoftware.cmake | 26 ++++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake index fbcb24a92363a..108a5eaf33b66 100644 --- a/cmake/modules/SearchInstalledSoftware.cmake +++ b/cmake/modules/SearchInstalledSoftware.cmake @@ -109,16 +109,18 @@ foreach(suffix FOUND INCLUDE_DIR LIBRARY LIBRARY_DEBUG LIBRARY_RELEASE LIBRARIES endforeach() # Request explicit user opt-in for required dependencies -ROOT_FIND_REQUIRED_DEP(Freetype builtin_freetype) -ROOT_FIND_REQUIRED_DEP(GIF builtin_gif) -ROOT_FIND_REQUIRED_DEP(JPEG builtin_jpeg) +if(asimage) + ROOT_FIND_REQUIRED_DEP(Freetype builtin_freetype) + ROOT_FIND_REQUIRED_DEP(GIF builtin_gif) + ROOT_FIND_REQUIRED_DEP(JPEG builtin_jpeg) + # We cannot PNG here because while searching PNG, CMake will also find ZLIB. + # If found, CMake will define the default variables and target: + # see https://cmake.org/cmake/help/latest/module/FindZLIB.html). + # For this reason, the check has to be put below, after ZLIB is searched for. + #ROOT_FIND_REQUIRED_DEP(PNG builtin_png) +endif() ROOT_FIND_REQUIRED_DEP(LZ4 builtin_lz4) ROOT_FIND_REQUIRED_DEP(LibLZMA builtin_lzma) -# We cannot PNG here because while searching PNG, CMake will also find ZLIB. -# If found, CMake will define the default variables and target: -# see https://cmake.org/cmake/help/latest/module/FindZLIB.html). -# For this reason, the check has to be put below, after ZLIB is searched for. -#ROOT_FIND_REQUIRED_DEP(PNG builtin_png) ROOT_FIND_REQUIRED_DEP(ZLIB builtin_zlib) ROOT_FIND_REQUIRED_DEP(ZSTD builtin_zstd) @@ -170,9 +172,11 @@ else() message(STATUS "Zlib detected") endif() -# This check can be added only now because of the reasons explained above, where all -# other required dependencies are checked. -ROOT_FIND_REQUIRED_DEP(PNG builtin_png) +if(asimage) + # This check can be added only now because of the reasons explained above, where all + # other required dependencies are checked. + ROOT_FIND_REQUIRED_DEP(PNG builtin_png) +endif() #---Check for nlohmann/json.hpp--------------------------------------------------------- if(NOT builtin_nlohmannjson) From f984cb05e089374e702812a3cc312c9261ae2197 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Mon, 30 Mar 2026 11:16:53 +0200 Subject: [PATCH 2/2] [cmake] error when asimage_tiff used in combination with minimal --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 146a23312ca38..6e05dc897ac2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -411,6 +411,9 @@ else() if(asimage) message(SEND_ERROR "minimal=ON is not compatible with asimage=ON. Consider setting instead gminimal=ON") endif() + if(asimage_tiff) + message(SEND_ERROR "minimal=ON is not compatible with asimage_tiff=ON. Consider setting instead gminimal=ON") + endif() if(x11) message(SEND_ERROR "minimal=ON is not compatible with x11=ON. Consider setting instead gminimal=ON") endif()