pdf-inspector: Support builddir != srcdir
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 875da79..09b2e67 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -43,6 +43,7 @@
     )
     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 1af646e..d2df5e3 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 @@
   
   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);