How to build a Gnome-builder created application with plain meson?

I created a new Python GTK application using gnome-Builder (let’s call it gtk-test). After creation, building and running it using Gnome-builder works just fine, gtk-test starts and shows the HelloWorld-window.

After that, I wanted to play around to around a bit with meson itself, so I tried to build the application by hand using meson directly. According to the meson documentation, the following steps should work

meson build
ninja -C build
./build/src/gtk-test

just fine.
Unfortunately, the last command always results in

Traceback (most recent call last):
  File "./build/src/gtk-test", line 37, in <module>
    resource = Gio.Resource.load(os.path.join(pkgdatadir, 'gtk-test.gresource'))
gi.repository.GLib.Error: g-file-error-quark: Failed to open file “/usr/local/share/gtk-test/gtk-test.gresource”: open() failed: No such file or directory (4)

What am I missing here?

Thanks in advance,
Björn

This is your hint here; your application is expecting that it has actually been installed with the paths set (or defaulted) when you ran meson build. In this case it hasn’t, so the runtime requirements are still only in build/.

On occasions where I want to do this, I usually set the prefix with meson to something like _install and install it using meson.

Thanks, I understand the problem now (and have it working now).