Line 0
Link Here
|
|
|
1 |
Fix this error: |
2 |
/usr/bin/ld: cannot find -lgtk-3 |
3 |
see https://stackoverflow.com/questions/29191855/what-is-the-proper-way-to-use-pkg-config-from-cmake |
4 |
need to add -L paths as well as -lgtk-3; try to leverage pkg-config |
5 |
Note: earlier attempt to change GTK3_LIBRARIES to PkgConfig::GTK3 didn't add -L paths to link.txt |
6 |
|
7 |
--- glib/demo/CMakeLists.txt.orig 2019-12-28 12:18:51 UTC |
8 |
+++ glib/demo/CMakeLists.txt |
9 |
@@ -27,4 +27,6 @@ |
10 |
taggedstruct.c |
11 |
) |
12 |
poppler_add_test(poppler-glib-demo BUILD_GTK_TESTS ${poppler_glib_demo_SRCS}) |
13 |
-target_link_libraries(poppler-glib-demo ${CAIRO_LIBRARIES} poppler-glib ${GTK3_LIBRARIES}) |
14 |
+find_package(PkgConfig REQUIRED) |
15 |
+pkg_check_modules(GTK3 REQUIRED IMPORTED_TARGET gtk+-3.0) |
16 |
+target_link_libraries(poppler-glib-demo ${CAIRO_LIBRARIES} poppler-glib PkgConfig::GTK3) |