summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2019-09-29 12:19:52 +0200
committerAlbert Astals Cid <aacid@kde.org>2019-09-29 12:19:52 +0200
commit5242a057594f3e635727a3b2f482a3aace10a0e4 (patch)
tree0f2bab1d9acdc201c1938b6793d486dfb48b9d62 /test
parentcb7de47e8da8aef49b63647112c6d4b615137c8c (diff)
pdf-inspector: Support builddir != srcdir
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt1
-rw-r--r--test/pdf-inspector.cc3
2 files changed, 3 insertions, 1 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 875da791..09b2e67a 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -43,6 +43,7 @@ if (GTK_FOUND)
)
poppler_add_test(pdf-inspector BUILD_GTK_TESTS ${pdf_inspector_SRCS})
target_link_libraries(pdf-inspector ${CAIRO_LIBRARIES} ${FREETYPE_LIBRARIES} ${common_libs} ${GTK3_LIBRARIES} poppler)
+ target_compile_definitions(pdf-inspector PRIVATE -DSRC_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
if(CMAKE_USE_PTHREADS_INIT)
target_link_libraries(pdf-inspector Threads::Threads)
endif()
diff --git a/test/pdf-inspector.cc b/test/pdf-inspector.cc
index 1af646ec..d2df5e30 100644
--- a/test/pdf-inspector.cc
+++ b/test/pdf-inspector.cc
@@ -4,6 +4,7 @@
//
// Copyright 2005 Jonathan Blandford <jrb@redhat.com>
// Copyright 2018 Adam Reichold <adam.reichold@t-online.de>
+// Copyright 2019 Albert Astals Cid <aacid@kde.org>
//
//========================================================================
@@ -69,7 +70,7 @@ PdfInspector::PdfInspector(void)
builder = gtk_builder_new ();
- if (!gtk_builder_add_from_file (builder, "./pdf-inspector.ui", &error))
+ if (!gtk_builder_add_from_file (builder, SRC_DIR "/pdf-inspector.ui", &error))
{
g_warning ("Couldn't load builder file: %s", error->message);
g_error_free (error);