add cmake option to prefer system lib to plutosvg
Some checks failed
ContinuousDelivery / linux-ubuntu (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android-23]) (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android-23]) (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android-23]) (push) Has been cancelled
ContinuousDelivery / windows (push) Has been cancelled
ContinuousDelivery / windows-asan (push) Has been cancelled
ContinuousDelivery / dumpsyms (push) Has been cancelled
ContinuousDelivery / release (push) Has been cancelled
ContinuousIntegration / linux (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android-23]) (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android-23]) (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android-23]) (push) Has been cancelled
ContinuousIntegration / macos (push) Has been cancelled
ContinuousIntegration / windows (push) Has been cancelled

This commit is contained in:
Green Sky 2025-04-08 00:10:03 +02:00
parent da42321807
commit ea9c02539e
No known key found for this signature in database
GPG Key ID: DBE05085D874AB4A

View File

@ -2,8 +2,28 @@ cmake_minimum_required(VERSION 3.24 FATAL_ERROR)
include(FetchContent)
#makes no sense without freetype
if (NOT TARGET plutosvg::plutosvg AND TARGET Freetype::Freetype)
if (NOT TARGET Freetype::Freetype)
#makes no sense without freetype
return()
endif()
option(TOMATO_DEP_PLUTOSVG_USE_SYSTEM "Prefer system provided plutosvg" OFF)
if (TOMATO_DEP_PLUTOSVG_USE_SYSTEM)
if (NOT TARGET plutosvg::plutosvg)
cmake_minimum_required(VERSION 3.24 FATAL_ERROR)
find_package(plutosvg 0.0.6 CONFIG GLOBAL QUIET)
endif()
if (TARGET plutosvg::plutosvg)
message(STATUS "found system plutosvg")
else()
message(STATUS "system plutosvg not found")
endif()
endif()
if (NOT TARGET plutosvg::plutosvg)
set(PLUTOSVG_ENABLE_FREETYPE ON CACHE INTERNAL "")
set(PLUTOSVG_BUILD_EXAMPLES OFF CACHE INTERNAL "")
FetchContent_Declare(plutosvg