[poppler] glib/demo glib/tests test/CMakeLists.txt

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Aug 23 20:35:45 UTC 2022


 glib/demo/CMakeLists.txt  |    7 -------
 glib/tests/CMakeLists.txt |    7 +------
 test/CMakeLists.txt       |    9 ++-------
 3 files changed, 3 insertions(+), 20 deletions(-)

New commits:
commit 619bfc1f280eed11523e6f8756460ed2598769b9
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Aug 23 22:31:24 2022 +0200

    cmake: Better linking against GTK3

diff --git a/glib/demo/CMakeLists.txt b/glib/demo/CMakeLists.txt
index 09215170..4c1ae9a5 100644
--- a/glib/demo/CMakeLists.txt
+++ b/glib/demo/CMakeLists.txt
@@ -1,10 +1,3 @@
-include_directories(
-  SYSTEM
-  ${GTK3_INCLUDE_DIRS}
-)
-
-add_definitions(${GTK3_CFLAGS_OTHER})
-
 set(poppler_glib_demo_SRCS
   main.c
   find.c
diff --git a/glib/tests/CMakeLists.txt b/glib/tests/CMakeLists.txt
index 9bbd4758..02985dfa 100644
--- a/glib/tests/CMakeLists.txt
+++ b/glib/tests/CMakeLists.txt
@@ -1,12 +1,7 @@
-include_directories(
-  ${GTK3_INCLUDE_DIRS}
-)
-
 macro(POPPLER_ADD_TESTCASE exe arg1)
   add_test(${exe}-${arg1} ${EXE} ${EXECUTABLE_OUTPUT_PATH}/poppler-check-bb ${TESTDATADIR}/unittestcases/${arg1} ${ARGN})
 endmacro(POPPLER_ADD_TESTCASE)
 
-add_definitions(${GTK3_CFLAGS_OTHER})
 add_definitions(-DTESTDATADIR=\"${TESTDATADIR}\")
 
 set(poppler_check_text_SRCS
@@ -54,7 +49,7 @@ macro(GLIB_ADD_FUZZER exe)
     ${ARGN}
   )
   poppler_add_test(${exe} BUILD_GTK_TESTS ${${test_name}_SOURCES})
-  target_link_libraries(${exe} poppler-glib ${GTK3_LIBRARIES})
+  target_link_libraries(${exe} poppler-glib PkgConfig::GTK3)
 endmacro(GLIB_ADD_FUZZER)
 
 if(ENABLE_FUZZER)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 4d57f665..6243c56d 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -13,11 +13,6 @@ endif ()
 
 if (GTK_FOUND)
 
-  include_directories(
-    SYSTEM
-    ${GTK3_INCLUDE_DIRS}
-  )
-
   include_directories(
     ${CMAKE_SOURCE_DIR}/glib
     ${CMAKE_BINARY_DIR}/glib
@@ -27,7 +22,7 @@ if (GTK_FOUND)
     gtk-test.cc
   )
   poppler_add_test(gtk-test BUILD_GTK_TESTS ${gtk_splash_test_SRCS})
-  target_link_libraries(gtk-test ${CAIRO_LIBRARIES} poppler-glib ${GTK3_LIBRARIES})
+  target_link_libraries(gtk-test ${CAIRO_LIBRARIES} poppler-glib PkgConfig::GTK3)
 
   if (HAVE_CAIRO)
 
@@ -38,7 +33,7 @@ if (GTK_FOUND)
       ${CMAKE_SOURCE_DIR}/poppler/CairoRescaleBox.cc
     )
     poppler_add_test(pdf-inspector BUILD_GTK_TESTS ${pdf_inspector_SRCS})
-    target_link_libraries(pdf-inspector ${CAIRO_LIBRARIES} Freetype::Freetype ${common_libs} ${GTK3_LIBRARIES} poppler)
+    target_link_libraries(pdf-inspector ${CAIRO_LIBRARIES} Freetype::Freetype ${common_libs} PkgConfig::GTK3 poppler)
     target_compile_definitions(pdf-inspector PRIVATE -DSRC_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
   endif ()
 


More information about the poppler mailing list