[poppler] CMakeLists.txt

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 16 17:37:59 UTC 2022


 CMakeLists.txt |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 8a14a2dd6fb837944a4465646b8154d75fe6c3cc
Author: Albert Astals Cid <aacid at kde.org>
Date:   Thu Jun 16 19:18:21 2022 +0200

    Make the pregenerated contents more stable
    
    by running sed to remove the path from gperf command line

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 056b7bfb..815c2a54 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -350,6 +350,7 @@ configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
 configure_file(poppler/poppler-config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/poppler/poppler-config.h)
 
 find_program(GPERF gperf)
+find_program(SED sed)
 
 set(poppler_SRCS
   goo/GooString.cc
@@ -536,11 +537,12 @@ if(Boost_FOUND)
   set(poppler_LIBS ${poppler_LIBS} Boost::boost)
 endif()
 
-if (GPERF AND RUN_GPERF_IF_PRESENT)
+if (GPERF AND SED AND RUN_GPERF_IF_PRESENT)
     macro(ADD_GPERF_FILE input)
         add_custom_command(OUTPUT poppler/${input}.c
                        COMMAND ${GPERF} poppler/${input}.gperf > ${CMAKE_CURRENT_BINARY_DIR}/poppler/${input}.c
                        COMMAND ${GPERF} poppler/${input}.gperf > ${CMAKE_CURRENT_SOURCE_DIR}/poppler/${input}.pregenerated.c
+                       COMMAND ${SED} -i "s#${GPERF}#gperf#" ${CMAKE_CURRENT_SOURCE_DIR}/poppler/${input}.pregenerated.c
                        COMMAND clang-format -i ${CMAKE_CURRENT_SOURCE_DIR}/poppler/${input}.pregenerated.c || true
                        DEPENDS poppler/${input}.gperf
                        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})


More information about the poppler mailing list