fix freetype is being installed from sources every time

This commit is contained in:
ohyzha
2024-10-21 17:55:48 +03:00
parent 5a74052c04
commit 74a9294aeb

View File

@@ -12,12 +12,13 @@ if (ENABLE_MSDF)
if(NOT DEFINED FREETYPE_REPO)
set(FREETYPE_REPO https://github.com/freetype/freetype.git)
endif()
unset(freetype_FOUND)
if (NOT DEFINED FREETYPE_BUILT_FROM_SOURCES)
unset(freetype_FOUND)
endif()
if (NOT IOS)
find_package(freetype QUIET)
endif ()
if (NOT freetype_FOUND OR NOT EXISTS "${CMAKE_BINARY_DIR}/_deps/freetype-src/build")
if (NOT freetype_FOUND AND NOT FREETYPE_BUILT_FROM_SOURCES)
message("Installing freetype from sources")
FetchContent_Declare(
freetype
@@ -55,6 +56,7 @@ if (ENABLE_MSDF)
endif()
set(FREETYPE_INCLUDE_DIR "${FT_SRC_DIR}/freetype-install/include/freetype2" CACHE INTERNAL "ft include dir" FORCE)
set(FREETYPE_BUILT_FROM_SOURCES ON CACHE BOOL "ft built from sources" FORCE)
set(freetype_FOUND ON CACHE BOOL "" FORCE)
list(APPEND CMAKE_PREFIX_PATH "${FT_SRC_DIR}/freetype-install")
endif()