From 8ce0e362bba655059601d467b2b8fb0ce92b0f57 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Sat, 14 May 2022 19:33:22 +0200 Subject: [PATCH] Messing around with --datadir, cleaning meson.build a bit To run the binary while debugging you should now configure with -Dscript_path=$HOME/your/source/dir --- meson.build | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index 00b6db7..c789e82 100644 --- a/meson.build +++ b/meson.build @@ -7,17 +7,18 @@ project('duckticker', 'cpp', compiler_opts = ['-DWRENPP_WITH_NAME_GUESSING'] +full_data_dir = get_option('prefix') / get_option('datadir') + global_config = configuration_data() global_config.set_quoted('PROJECT_NAME', meson.project_name()) version_arr = meson.project_version().split('.') global_config.set('PROJECT_VERSION_MAJOR', version_arr[0]) global_config.set('PROJECT_VERSION_MINOR', version_arr[1]) global_config.set('PROJECT_VERSION_PATCH', version_arr[2]) -global_config.set_quoted('SCRIPT_PATH', get_option('prefix') / get_option('script_path') / '') +global_config.set_quoted('SCRIPT_PATH', full_data_dir / get_option('script_path') / '') subdir('src') -#full_config_dir = get_option('prefix') / get_option('sysconfdir') -#if meson.source_root() != full_config_dir -# install_data(sources: meson.project_name() + '.conf', install_dir: full_config_dir) -#endif +if meson.project_source_root() != full_data_dir + install_data(sources: 'script/main.wren', install_dir: full_data_dir) +endif