shithub: freetype+ttf2subf

Download patch

ref: 97b757de4b120a6a899c0f49b84b41d794a3b8af
parent: 22479ca825804c66168beba6f685f67508da4a60
author: Werner Lemberg <[email protected]>
date: Sun Jun 28 06:42:47 EDT 2015

* CMakeLists.txt: Fix creation of `ftconfig.h'.
Check for UNIX header files using `check_include_file'.
Set up correct header include directories.

git/fs: mount .git/fs: mount/attach disallowed
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -58,6 +58,10 @@
 
 cmake_minimum_required(VERSION 2.6)
 
+
+include(CheckIncludeFile)
+
+
 # CMAKE_TOOLCHAIN_FILE must be set before `project' is called, which
 # configures the base build environment and references the toolchain file
 if (APPLE)
@@ -128,25 +132,37 @@
 # Compiler definitions for building the library
 add_definitions(-DFT2_BUILD_LIBRARY)
 
-# Specify library include directories
-include_directories("${PROJECT_SOURCE_DIR}/include")
 
+message(STATUS
+  "Creating directory ${PROJECT_BINARY_DIR}/include/freetype/config")
+file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/include/freetype/config")
+
 # Create the configuration file
 if (UNIX)
-  message(STATUS
-    "Creating directory ${PROJECT_BINARY_DIR}/include/freetype/config")
-  file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/include/freetype/config")
+  check_include_file("unistd.h" HAVE_UNISTD_H)
+  check_include_file("fcntl.h" HAVE_FCNTL_H)
+  check_include_file("stdint.h" HAVE_STDINT_H)
 
-  include_directories(BEFORE "${PROJECT_BINARY_DIR}/include/freetype/config")
   message(STATUS
     "Creating file ${PROJECT_BINARY_DIR}/include/freetype/config/ftconfig.h")
 
   file(READ "${PROJECT_SOURCE_DIR}/builds/unix/ftconfig.in"
     FTCONFIG_H)
-  string(REPLACE "FT_CONFIG_OPTIONS_H" "ftoption.h"
-    FTCONFIG_H "${FTCONFIG_H}")
-  string(REPLACE "FT_CONFIG_STANDARD_LIBRARY_H" "ftstdlib.h"
-    FTCONFIG_H "${FTCONFIG_H}")
+  if (HAVE_UNISTD_H)
+    string(REGEX REPLACE
+      "#undef +(HAVE_UNISTD_H)" "#define \\1"
+      FTCONFIG_H "${FTCONFIG_H}")
+  endif ()
+  if (HAVE_FCNTL_H)
+    string(REGEX REPLACE
+      "#undef +(HAVE_FCNTL_H)" "#define \\1"
+      FTCONFIG_H "${FTCONFIG_H}")
+  endif ()
+  if (HAVE_STDINT_H)
+    string(REGEX REPLACE
+      "#undef +(HAVE_STDINT_H)" "#define \\1"
+      FTCONFIG_H "${FTCONFIG_H}")
+  endif ()
   string(REPLACE "/undef " "#undef "
     FTCONFIG_H "${FTCONFIG_H}")
   file(WRITE "${PROJECT_BINARY_DIR}/include/freetype/config/ftconfig.h"
@@ -153,6 +169,12 @@
     "${FTCONFIG_H}")
 endif ()
 
+
+# Specify library include directories
+include_directories("${PROJECT_SOURCE_DIR}/include")
+include_directories(BEFORE "${PROJECT_BINARY_DIR}/include")
+
+
 file(GLOB PUBLIC_HEADERS "include/ft2build.h" "include/freetype/*.h")
 file(GLOB PUBLIC_CONFIG_HEADERS "include/freetype/config/*.h")
 file(GLOB PRIVATE_HEADERS "include/freetype/internal/*.h")
@@ -209,13 +231,6 @@
   set(BASE_SRCS ${BASE_SRCS} src/base/ftdebug.c)
 endif ()
 
-include_directories("src/truetype")
-include_directories("src/sfnt")
-include_directories("src/autofit")
-include_directories("src/smooth")
-include_directories("src/raster")
-include_directories("src/psaux")
-include_directories("src/psnames")
 
 if (BUILD_FRAMEWORK)
   set(BASE_SRCS
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2015-06-28  Werner Lemberg  <[email protected]>
 
+	* CMakeLists.txt: Fix creation of `ftconfig.h'.
+	Check for UNIX header files using `check_include_file'.
+	Set up correct header include directories.
+
+2015-06-28  Werner Lemberg  <[email protected]>
+
 	* CMakeLists.txt: Disallow in-source builds.
 
 2015-06-27  Werner Lemberg  <[email protected]>