* CMakeLists.txt: Fix creation of `ftconfig.h'. Check for UNIX header files using `check_include_file'. Set up correct header include directories.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 193a33b..8cea5a4 100644
--- 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,31 +132,49 @@ set(PROJECT_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
# 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"
"${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 @@ else ()
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
diff --git a/ChangeLog b/ChangeLog
index d19b618..5310ccf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2015-06-28 Werner Lemberg <wl@gnu.org>
+ * 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 <wl@gnu.org>
+
* CMakeLists.txt: Disallow in-source builds.
2015-06-27 Werner Lemberg <wl@gnu.org>