summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2015-06-25 16:38:11 +0200
committerWerner Lemberg <wl@gnu.org>2015-06-26 06:48:01 +0200
commit68222dd12245fca50a3e662b200a0e3e3b22db38 (patch)
tree63d305c0bb1708c0d3560499f72eec9a1d92e3b1 /CMakeLists.txt
parent5ef5a4fd8bbc9b6b1eaf69d2be0741bf4fac819a (diff)
downloadfreetype2-68222dd12245fca50a3e662b200a0e3e3b22db38.tar.gz
* CMakeLists.txt: Use cmake functions for generating `ftconfig.h'.
Additionally, do this for UNIX only.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt31
1 files changed, 20 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3121beead..55b5bfe7f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -115,17 +115,26 @@ add_definitions(-DFT2_BUILD_LIBRARY)
include_directories("${PROJECT_SOURCE_DIR}/include")
# Create the configuration file
-message(STATUS "Creating directory, ${PROJECT_BINARY_DIR}/include/freetype/config.")
-file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include/freetype/config)
-
-# For the auto-generated ftconfig.h file
-include_directories(BEFORE "${PROJECT_BINARY_DIR}/include/freetype/config")
-message(STATUS "Creating ${PROJECT_BINARY_DIR}/include/freetype/config/ftconfig.h.")
-execute_process(
- COMMAND sed -e "s/FT_CONFIG_OPTIONS_H/<ftoption.h>/" -e "s/FT_CONFIG_STANDARD_LIBRARY_H/<ftstdlib.h>/" -e "s?/undef ?#undef ?"
- INPUT_FILE ${PROJECT_SOURCE_DIR}/builds/unix/ftconfig.in
- OUTPUT_FILE ${PROJECT_BINARY_DIR}/include/freetype/config/ftconfig.h
-)
+if (UNIX)
+ message(STATUS
+ "Creating directory ${PROJECT_BINARY_DIR}/include/freetype/config")
+ file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/include/freetype/config")
+
+ 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}")
+ string(REPLACE "/undef " "#undef "
+ FTCONFIG_H "${FTCONFIG_H}")
+ file(WRITE "${PROJECT_BINARY_DIR}/include/freetype/config/ftconfig.h"
+ "${FTCONFIG_H}")
+endif ()
file(GLOB PUBLIC_HEADERS "include/ft2build.h" "include/freetype/*.h")
file(GLOB PUBLIC_CONFIG_HEADERS "include/freetype/config/*.h")