summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDavid Capello <davidcapello@gmail.com>2016-06-09 10:55:52 +0200
committerWerner Lemberg <wl@gnu.org>2016-06-09 10:55:52 +0200
commitf40d7d2b6d90ff73d4340b06953210b79b0651e4 (patch)
tree9853330ac1f1912b824369e90ee4c670ecb8c350 /CMakeLists.txt
parentb6b26f45352633770fe676fc35e79221b6b9ce27 (diff)
downloadfreetype2-f40d7d2b6d90ff73d4340b06953210b79b0651e4.tar.gz
[cmake] Avoid modifying `ftconfig.h' and `ftoption.h' files.
* CMakeLists.txt: Each time cmake is run those files are modified and the whole FreeType library is recompiled. With this change we change the files only if there are real modifications, so we can avoid recompilations.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 9 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 87a68c0f2..3b36efe96 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -215,14 +215,17 @@ if (UNIX)
endif ()
string(REPLACE "/undef " "#undef "
FTCONFIG_H "${FTCONFIG_H}")
- file(WRITE "${PROJECT_BINARY_DIR}/include/freetype/config/ftconfig.h"
+ file(WRITE "${PROJECT_BINARY_DIR}/include/freetype/config/ftconfig.h-new"
"${FTCONFIG_H}")
else ()
file(READ "${PROJECT_SOURCE_DIR}/include/freetype/config/ftconfig.h"
FTCONFIG_H)
- file(WRITE "${PROJECT_BINARY_DIR}/include/freetype/config/ftconfig.h"
+ file(WRITE "${PROJECT_BINARY_DIR}/include/freetype/config/ftconfig.h-new"
"${FTCONFIG_H}")
endif ()
+execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ "${PROJECT_BINARY_DIR}/include/freetype/config/ftconfig.h-new"
+ "${PROJECT_BINARY_DIR}/include/freetype/config/ftconfig.h")
# Create the options file
@@ -251,8 +254,11 @@ if (HARFBUZZ_FOUND)
"/\\* +(#define +FT_CONFIG_OPTION_USE_HARFBUZZ) +\\*/" "\\1"
FTOPTION_H "${FTOPTION_H}")
endif ()
-file(WRITE "${PROJECT_BINARY_DIR}/include/freetype/config/ftoption.h"
+file(WRITE "${PROJECT_BINARY_DIR}/include/freetype/config/ftoption.h-new"
"${FTOPTION_H}")
+execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ "${PROJECT_BINARY_DIR}/include/freetype/config/ftoption.h-new"
+ "${PROJECT_BINARY_DIR}/include/freetype/config/ftoption.h")
# Specify library include directories