tomato/external/plutosvg/CMakeLists.txt
Green Sky ea9c02539e
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
add cmake option to prefer system lib to plutosvg
2025-04-08 00:10:03 +02:00

37 lines
903 B
CMake

cmake_minimum_required(VERSION 3.24 FATAL_ERROR)
include(FetchContent)
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
GIT_REPOSITORY https://github.com/sammycage/plutosvg.git
GIT_TAG v0.0.6
FIND_PACKAGE_ARGS # for the future
)
FetchContent_MakeAvailable(plutosvg)
endif()