ref: ebe375081289844e580242fe7956fa2082ab89b6
parent: 8837ac26d00f5a433ec9fd8bc08446b6df4c5bd5
author: Minmin Gong <[email protected]>
date: Mon Apr 15 06:46:19 EDT 2019
* CMakeLists.txt: Avoid rewriting of unchanged configuration files. Reported as https://savannah.nongnu.org/patch/index.php?9755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -234,14 +234,22 @@
endif ()
string(REPLACE "/undef " "#undef "
FTCONFIG_H "${FTCONFIG_H}")
-else()
+else ()
file(READ "${PROJECT_SOURCE_DIR}/include/freetype/config/ftconfig.h"
FTCONFIG_H)
endif ()
-file(WRITE "${PROJECT_BINARY_DIR}/include/freetype/config/ftconfig.h"
- "${FTCONFIG_H}")
+set(FTCONFIG_H_NAME "${PROJECT_BINARY_DIR}/include/freetype/config/ftconfig.h")
+if (EXISTS "${FTCONFIG_H_NAME}")
+ file(READ "${FTCONFIG_H_NAME}" ORIGINAL_FTCONFIG_H)
+else ()
+ set(ORIGINAL_FTCONFIG_H "")
+endif ()
+if (NOT (ORIGINAL_FTCONFIG_H STREQUAL FTCONFIG_H))
+ file(WRITE "${FTCONFIG_H_NAME}" "${FTCONFIG_H}")
+endif ()
+
# Create the options file
file(READ "${PROJECT_SOURCE_DIR}/include/freetype/config/ftoption.h"
FTOPTION_H)
@@ -265,10 +273,18 @@
"/\\* +(#define +FT_CONFIG_OPTION_USE_HARFBUZZ) +\\*/" "\\1"
FTOPTION_H "${FTOPTION_H}")
endif ()
-file(WRITE "${PROJECT_BINARY_DIR}/include/freetype/config/ftoption.h"
- "${FTOPTION_H}")
+set(FTOPTION_H_NAME "${PROJECT_BINARY_DIR}/include/freetype/config/ftoption.h")
+if (EXISTS "${FTOPTION_H_NAME}")
+ file(READ "${FTOPTION_H_NAME}" ORIGINAL_FTOPTION_H)
+else ()
+ set(ORIGINAL_FTOPTION_H "")
+endif ()
+if (NOT (ORIGINAL_FTOPTION_H STREQUAL FTOPTION_H))
+ file(WRITE "${FTOPTION_H_NAME}" "${FTOPTION_H}")
+endif ()
+
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")
@@ -333,7 +349,7 @@
if (NOT DISABLE_FORCE_DEBUG_POSTFIX)
set(CMAKE_DEBUG_POSTFIX d)
-endif()
+endif ()
add_library(freetype
@@ -456,7 +472,15 @@
string(REPLACE "%LIBS_PRIVATE%" "" # All libs support pkg-config
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
- file(WRITE ${PROJECT_BINARY_DIR}/freetype2.pc ${FREETYPE2_PC_IN})
+ set(FREETYPE2_PC_IN_NAME "${PROJECT_BINARY_DIR}/freetype2.pc")
+ if (EXISTS "${FREETYPE2_PC_IN_NAME}")
+ file(READ "${FREETYPE2_PC_IN_NAME}" ORIGINAL_FREETYPE2_PC_IN)
+ else ()
+ set(ORIGINAL_FREETYPE2_PC_IN "")
+ endif ()
+ if (NOT (ORIGINAL_FREETYPE2_PC_IN STREQUAL FREETYPE2_PC_IN))
+ file(WRITE "${FREETYPE2_PC_IN_NAME}" ${FREETYPE2_PC_IN})
+ endif ()
install(
FILES ${PROJECT_BINARY_DIR}/freetype2.pc
@@ -493,9 +517,9 @@
if (WIN32)
set(CPACK_GENERATOR ZIP)
-else()
+else ()
set(CPACK_GENERATOR TGZ)
-endif()
+endif ()
set(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries")
set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C/C++ Headers")
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2019-04-15 Minmin Gong <[email protected]>
+
+ * CMakeLists.txt: Avoid rewriting of unchanged configuration files.
+
+ Reported as
+
+ https://savannah.nongnu.org/patch/index.php?9755
+
2019-04-15 JDG <[email protected]>
* src/tools/apinames.c (main): Fix error message.