From ee5308448df83e316aae19d2f152555d1cabb04d Mon Sep 17 00:00:00 2001 From: Sergey Linev Date: Fri, 22 May 2026 13:22:24 +0200 Subject: [PATCH 1/2] [cmake] support legacy freetype cmake On mac homebrew installation of freetype Freetype_VERSION not returned. Instead FREETYPE_VERSION_STRING is set. --- cmake/modules/SearchInstalledSoftware.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake index d4621826b211c..fb3ba29c6804a 100644 --- a/cmake/modules/SearchInstalledSoftware.cmake +++ b/cmake/modules/SearchInstalledSoftware.cmake @@ -254,6 +254,10 @@ ROOT_FIND_REQUIRED_DEP(Freetype builtin_freetype) # needed for asimage, but also if(builtin_freetype) list(APPEND ROOT_BUILTINS BUILTIN_FREETYPE) add_subdirectory(builtins/freetype) +elseif(NOT Freetype_VERSION AND FREETYPE_VERSION_STRING) + # on mac brew installed freetype version_string is returned + message(STATUS "Found legacy freetype ${FREETYPE_VERSION_STRING}") + set(Freetype_VERSION ${FREETYPE_VERSION_STRING}) endif() #---Check for Cocoa/Quartz graphics backend (MacOS X only)--------------------------- @@ -369,7 +373,7 @@ if(asimage) get_target_property(JPEG_LIBRARY_LOCATION JPEG::JPEG IMPORTED_LOCATION) endif() list(APPEND ASEXTRA_LIBRARIES JPEG::JPEG) - + if(builtin_tiff) add_subdirectory(builtins/libtiff) get_target_property(TIFF_INCLUDE_DIR TIFF::TIFF INTERFACE_INCLUDE_DIRECTORIES) From 71bfc69139c49e4c8eebbadec192060bab247d57 Mon Sep 17 00:00:00 2001 From: Sergey Linev Date: Fri, 22 May 2026 13:26:36 +0200 Subject: [PATCH 2/2] [cmake] adjust builtin ftgl Simplify patch file names Use common naming convention --- ...brary.h-from-libftgl_l.patch => 0001-fix-CMakeLists.patch} | 0 .../{prevent_nullptr_access.patch => 0003-fix-nullptr.patch} | 0 builtins/ftgl/CMakeLists.txt | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) rename builtins/ftgl/{0001-src-CMakeLists.txt-remove-FTLibrary.h-from-libftgl_l.patch => 0001-fix-CMakeLists.patch} (100%) rename builtins/ftgl/{prevent_nullptr_access.patch => 0003-fix-nullptr.patch} (100%) diff --git a/builtins/ftgl/0001-src-CMakeLists.txt-remove-FTLibrary.h-from-libftgl_l.patch b/builtins/ftgl/0001-fix-CMakeLists.patch similarity index 100% rename from builtins/ftgl/0001-src-CMakeLists.txt-remove-FTLibrary.h-from-libftgl_l.patch rename to builtins/ftgl/0001-fix-CMakeLists.patch diff --git a/builtins/ftgl/prevent_nullptr_access.patch b/builtins/ftgl/0003-fix-nullptr.patch similarity index 100% rename from builtins/ftgl/prevent_nullptr_access.patch rename to builtins/ftgl/0003-fix-nullptr.patch diff --git a/builtins/ftgl/CMakeLists.txt b/builtins/ftgl/CMakeLists.txt index 4fdac05808f5f..1c06846261b84 100644 --- a/builtins/ftgl/CMakeLists.txt +++ b/builtins/ftgl/CMakeLists.txt @@ -12,14 +12,14 @@ if (CMAKE_BUILD_TYPE MATCHES Debug) set(ROOT_FTGL_POSTFIX d) endif() # Cherry-pick https://github.com/frankheckenbach/ftgl/commit/835f2ba7911a6c15a1a314d5e3267fa089b5a319 : -set(ROOT_FTGL_PATCH_FILE_1 "${CMAKE_CURRENT_SOURCE_DIR}/0001-src-CMakeLists.txt-remove-FTLibrary.h-from-libftgl_l.patch") +set(ROOT_FTGL_PATCH_FILE_1 "${CMAKE_CURRENT_SOURCE_DIR}/0001-fix-CMakeLists.patch") # From https://github.com/frankheckenbach/ftgl/issues/22, see also https://github.com/xmake-io/xmake-repo/pull/9040/changes and https://github.com/root-project/root/commit/a028d13255f0c2d0c84f2e1b99ccb6a112598e0c if(Freetype_VERSION VERSION_GREATER_EQUAL 2.13.3) # https://github.com/root-project/root/commit/a028d13255f0c2d0c84f2e1b99ccb6a112598e0c set(ROOT_FTGL_PATCH_FILE_2 "${CMAKE_CURRENT_SOURCE_DIR}/0002-fix-type-error.patch") else() set(ROOT_FTGL_PATCH_FILE_2 "") endif() -set(ROOT_FTGL_PATCH_FILE_3 "${CMAKE_CURRENT_SOURCE_DIR}/prevent_nullptr_access.patch") # https://github.com/root-project/root/issues/22076#issuecomment-4335481094 +set(ROOT_FTGL_PATCH_FILE_3 "${CMAKE_CURRENT_SOURCE_DIR}/0003-fix-nullptr.patch") # https://github.com/root-project/root/issues/22076#issuecomment-4335481094 set(ROOT_FTGL_PREFIX ${CMAKE_BINARY_DIR}/builtins/FTGL-prefix) set(ROOT_FTGL_LIBRARY ${ROOT_FTGL_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}ftgl${ROOT_FTGL_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})