CMake: find PangoFT2 when wxUSE_PRIVATE_FONTS is enabled in GTK
Rewrite and simplify FindFontconfig.
This commit is contained in:
@@ -420,8 +420,9 @@ if(wxUSE_GUI)
|
|||||||
|
|
||||||
if(wxUSE_PRIVATE_FONTS AND WXGTK)
|
if(wxUSE_PRIVATE_FONTS AND WXGTK)
|
||||||
find_package(Fontconfig)
|
find_package(Fontconfig)
|
||||||
if(NOT FONTCONFIG_FOUND)
|
find_package(PangoFT2)
|
||||||
message(WARNING "Fontconfig not found, Private fonts won't be available")
|
if(NOT FONTCONFIG_FOUND OR NOT PANGOFT2_FOUND)
|
||||||
|
message(WARNING "Fontconfig or PangoFT2 not found, Private fonts won't be available")
|
||||||
wx_option_force_value(wxUSE_PRIVATE_FONTS OFF)
|
wx_option_force_value(wxUSE_PRIVATE_FONTS OFF)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
@@ -77,8 +77,8 @@ if(WXOSX_COCOA)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if(WXGTK AND wxUSE_PRIVATE_FONTS)
|
if(WXGTK AND wxUSE_PRIVATE_FONTS)
|
||||||
wx_lib_include_directories(core PUBLIC ${FONTCONFIG_INCLUDE_DIR})
|
wx_lib_include_directories(core PUBLIC ${FONTCONFIG_INCLUDE_DIRS} ${PANGOFT2_INCLUDE_DIRS})
|
||||||
wx_lib_link_libraries(core PUBLIC ${FONTCONFIG_LIBRARIES})
|
wx_lib_link_libraries(core PUBLIC ${FONTCONFIG_LIBRARIES} ${PANGOFT2_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
if(wxUSE_LIBSDL)
|
if(wxUSE_LIBSDL)
|
||||||
if(SDL2_FOUND)
|
if(SDL2_FOUND)
|
||||||
|
@@ -1,69 +1,30 @@
|
|||||||
# - Try to find the Fontconfig
|
# - Try to find Fontconfig
|
||||||
# Once done this will define
|
# Once done this will define
|
||||||
#
|
#
|
||||||
# FONTCONFIG_FOUND - system has Fontconfig
|
# FONTCONFIG_FOUND - system has Fontconfig
|
||||||
# FONTCONFIG_INCLUDE_DIR - The include directory to use for the fontconfig headers
|
# FONTCONFIG_INCLUDE_DIRS - The include directory to use for the Fontconfig headers
|
||||||
# FONTCONFIG_LIBRARIES - Link these to use FONTCONFIG
|
# FONTCONFIG_LIBRARIES - Link these to use Fontconfig
|
||||||
# FONTCONFIG_DEFINITIONS - Compiler switches required for using FONTCONFIG
|
|
||||||
|
|
||||||
# Copyright (c) 2006,2007 Laurent Montel, <montel@kde.org>
|
|
||||||
#
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions
|
|
||||||
# are met:
|
|
||||||
#
|
|
||||||
# 1. Redistributions of source code must retain the copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# 2. Redistributions in binary form must reproduce the copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer in the
|
|
||||||
# documentation and/or other materials provided with the distribution.
|
|
||||||
# 3. The name of the author may not be used to endorse or promote products
|
|
||||||
# derived from this software without specific prior written permission.
|
|
||||||
#
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
||||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
||||||
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
||||||
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
||||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
||||||
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
||||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
#
|
|
||||||
|
|
||||||
if (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR)
|
|
||||||
|
|
||||||
# in cache already
|
|
||||||
set(FONTCONFIG_FOUND TRUE)
|
|
||||||
|
|
||||||
else (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR)
|
|
||||||
|
|
||||||
if (NOT WIN32)
|
|
||||||
# use pkg-config to get the directories and then use these values
|
|
||||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
|
||||||
find_package(PkgConfig)
|
find_package(PkgConfig)
|
||||||
pkg_check_modules(PC_FONTCONFIG QUIET fontconfig)
|
pkg_check_modules(PC_FONTCONFIG QUIET fontconfig)
|
||||||
|
|
||||||
set(FONTCONFIG_DEFINITIONS ${PC_FONTCONFIG_CFLAGS_OTHER})
|
find_path(FONTCONFIG_INCLUDE_DIRS
|
||||||
endif (NOT WIN32)
|
NAMES fontconfig.h
|
||||||
|
HINTS ${PC_FONTCONFIG_INCLUDEDIR}
|
||||||
find_path(FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h
|
|
||||||
PATHS
|
|
||||||
${PC_FONTCONFIG_INCLUDEDIR}
|
|
||||||
${PC_FONTCONFIG_INCLUDE_DIRS}
|
${PC_FONTCONFIG_INCLUDE_DIRS}
|
||||||
/usr/X11/include
|
PATH_SUFFIXES fontconfig
|
||||||
)
|
)
|
||||||
|
|
||||||
find_library(FONTCONFIG_LIBRARIES NAMES fontconfig
|
find_library(FONTCONFIG_LIBRARIES
|
||||||
PATHS
|
NAMES fontconfig
|
||||||
${PC_FONTCONFIG_LIBDIR}
|
HINTS ${PC_FONTCONFIG_LIBDIR}
|
||||||
${PC_FONTCONFIG_LIBRARY_DIRS}
|
${PC_FONTCONFIG_LIBRARY_DIRS}
|
||||||
)
|
)
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Fontconfig DEFAULT_MSG FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR )
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FONTCONFIG DEFAULT_MSG FONTCONFIG_INCLUDE_DIRS FONTCONFIG_LIBRARIES)
|
||||||
|
|
||||||
mark_as_advanced(FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR)
|
mark_as_advanced(
|
||||||
|
FONTCONFIG_INCLUDE_DIRS
|
||||||
endif (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR)
|
FONTCONFIG_LIBRARIES
|
||||||
|
)
|
||||||
|
30
build/cmake/modules/FindPangoFT2.cmake
Normal file
30
build/cmake/modules/FindPangoFT2.cmake
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
# - Try to find PangoFT2
|
||||||
|
# Once done this will define
|
||||||
|
#
|
||||||
|
# PANGOFT2_FOUND - system has PangoFT2
|
||||||
|
# PANGOFT2_INCLUDE_DIRS - The include directory to use for the PangoFT2 headers
|
||||||
|
# PANGOFT2_LIBRARIES - Link these to use PangoFT2
|
||||||
|
|
||||||
|
find_package(PkgConfig)
|
||||||
|
pkg_check_modules(PC_PANGOFT2 QUIET pangoft2)
|
||||||
|
|
||||||
|
find_path(PANGOFT2_INCLUDE_DIRS
|
||||||
|
NAMES pango-context.h
|
||||||
|
HINTS ${PC_PANGOFT2_INCLUDEDIR}
|
||||||
|
${PC_PANGOFT2_INCLUDE_DIRS}
|
||||||
|
PATH_SUFFIXES pango
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(PANGOFT2_LIBRARIES
|
||||||
|
NAMES pangoft2-1.0
|
||||||
|
HINTS ${PC_PANGOFT2_LIBDIR}
|
||||||
|
${PC_PANGOFT2_LIBRARY_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PANGOFT2 REQUIRED_VARS PANGOFT2_INCLUDE_DIRS PANGOFT2_LIBRARIES)
|
||||||
|
|
||||||
|
mark_as_advanced(
|
||||||
|
PANGOFT2_INCLUDE_DIRS
|
||||||
|
PANGOFT2_LIBRARIES
|
||||||
|
)
|
Reference in New Issue
Block a user