From ae1897cf2ce6a447b253ffa8489b5c016a23fb41 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 5 Aug 2024 21:25:59 +0200 Subject: Resources path should use the same path as meson installed path --- meson.build | 9 ++++++--- src/main.cpp | 9 +++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index 59a02e3..0b428f4 100644 --- a/meson.build +++ b/meson.build @@ -31,13 +31,16 @@ dep = [ mglpp_dep, ] +prefix = get_option('prefix') +datadir = get_option('datadir') +gsr_overlay_resources_path = join_paths(prefix, datadir, 'gsr-overlay') + executable( meson.project_name(), src, install : true, dependencies : dep, + cpp_args : '-DGSR_OVERLAY_RESOURCES_PATH="' + gsr_overlay_resources_path + '"', ) -prefix = get_option('prefix') -datadir = get_option('datadir') -install_subdir('images', install_dir : join_paths(prefix, datadir, 'gsr-overlay')) \ No newline at end of file +install_subdir('images', install_dir : gsr_overlay_resources_path) \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 8fb12cd..ed8fba7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -396,10 +396,15 @@ int main(int argc, char **argv) { gsr::init_theme(gsr_info); std::string project_dir; - if(access("images/gpu_screen_recorder_logo.png", F_OK) == 0) + if(access("images/gpu_screen_recorder_logo.png", F_OK) == 0) { project_dir = "./"; - else + } else { +#ifdef GSR_OVERLAY_RESOURCES_PATH + project_dir = GSR_OVERLAY_RESOURCES_PATH "/"; +#else project_dir = "/usr/share/gsr-overlay/"; +#endif + } mgl::Init init; Display *display = (Display*)mgl_get_context()->connection; -- cgit v1.2.3