From 61497f97fb3db04ef1e3b4606f5023dccd52d2cf Mon Sep 17 00:00:00 2001 From: Tobias Peters Date: Sun, 14 Jul 2024 09:49:21 +0000 Subject: [PATCH] use built-in FindFreetype module --- CMakeModules/FindFreeType.cmake | 110 -------------------------------- nel/CMakeLists.txt | 2 +- 2 files changed, 1 insertion(+), 111 deletions(-) delete mode 100644 CMakeModules/FindFreeType.cmake diff --git a/CMakeModules/FindFreeType.cmake b/CMakeModules/FindFreeType.cmake deleted file mode 100644 index d101607b48..0000000000 --- a/CMakeModules/FindFreeType.cmake +++ /dev/null @@ -1,110 +0,0 @@ -# - Locate FreeType library -# This module defines -# FREETYPE_LIBRARIES, libraries to link against -# FREETYPE_FOUND, if false, do not try to link to FREETYPE -# FREETYPE_INCLUDE_DIRS, where to find headers. - -IF(FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIRS) - # in cache already - SET(Freetype_FIND_QUIETLY TRUE) -ENDIF() - -FIND_PATH(FREETYPE_INCLUDE_DIRS - freetype - PATHS - $ENV{FREETYPE_DIR}/include - /usr/local/include - /usr/include - /sw/include - /opt/local/include - /opt/csw/include - /opt/include - PATH_SUFFIXES freetype2 -) - -IF(NOT FREETYPE_INCLUDE_DIRS) - SET(FREETYPE_INCLUDE_DIRS "") -ENDIF() - -# ft2build.h does not reside in the freetype include dir -FIND_PATH(FREETYPE_ADDITIONAL_INCLUDE_DIR - ft2build.h - PATHS - /usr/local/include - /usr/include - /sw/include - /opt/local/include - /opt/csw/include - /opt/include - PATH_SUFFIXES freetype2 -) - -# combine both include directories into one variable -IF(FREETYPE_ADDITIONAL_INCLUDE_DIR) - SET(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS} ${FREETYPE_ADDITIONAL_INCLUDE_DIR}) -ENDIF() - -FIND_LIBRARY(FREETYPE_LIBRARY_RELEASE - NAMES freetype libfreetype freetype219 freetype246 - PATHS - $ENV{FREETYPE_DIR}/lib - /usr/local/lib - /usr/lib - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 - /usr/lib/x86_64-linux-gnu -) - -FIND_LIBRARY(FREETYPE_LIBRARY_DEBUG - NAMES freetyped libfreetyped freetype219d freetype246d - PATHS - $ENV{FREETYPE_DIR}/lib - /usr/local/lib - /usr/lib - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 - /usr/lib/x86_64-linux-gnu -) - -IF(FREETYPE_INCLUDE_DIRS) - IF(FREETYPE_LIBRARY_RELEASE AND FREETYPE_LIBRARY_DEBUG) - # Case where both Release and Debug versions are provided - SET(FREETYPE_FOUND ON) - SET(FREETYPE_LIBRARIES optimized ${FREETYPE_LIBRARY_RELEASE} debug ${FREETYPE_LIBRARY_DEBUG}) - ELSEIF(FREETYPE_LIBRARY_RELEASE) - # Normal case - SET(FREETYPE_FOUND ON) - SET(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY_RELEASE}) - ELSEIF(FREETYPE_LIBRARY_DEBUG) - # Case where Freetype is compiled from sources (debug version is compiled by default) - SET(FREETYPE_FOUND ON) - SET(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY_DEBUG}) - ENDIF() -ENDIF() - -IF(FREETYPE_FOUND) - IF(WITH_STATIC_EXTERNAL AND APPLE) - FIND_PACKAGE(BZip2) - IF(BZIP2_FOUND) - SET(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS} ${BZIP2_INCLUDE_DIR}) - SET(FREETYPE_LIBRARIES ${FREETYPE_LIBRARIES} ${BZIP2_LIBRARIES}) - ENDIF() - ENDIF() - IF(NOT Freetype_FIND_QUIETLY) - MESSAGE(STATUS "Found FreeType: ${FREETYPE_LIBRARIES}") - ENDIF() -ELSE() - IF(NOT Freetype_FIND_QUIETLY) - MESSAGE(STATUS "Warning: Unable to find FreeType!") - ENDIF() -ENDIF() diff --git a/nel/CMakeLists.txt b/nel/CMakeLists.txt index 1392c6dbd2..a41a96fbf2 100644 --- a/nel/CMakeLists.txt +++ b/nel/CMakeLists.txt @@ -23,7 +23,7 @@ IF(WITH_3D) FIND_PACKAGE(freetype CONFIG REQUIRED) SET(FREETYPE_LIBRARIES freetype::freetype) ELSE() - FIND_PACKAGE(FreeType) + FIND_PACKAGE(Freetype) ENDIF() #hunter IF(WITH_NEL_CEGUI)