diff --git a/meson.build b/meson.build index 1eb06e4..851330a 100644 --- a/meson.build +++ b/meson.build @@ -94,18 +94,32 @@ project_target = executable( c_args : build_args, ) -install_man('spmenu.1') -install_man('spmenu_run.1') -install_man('spmenu_test.1') -install_data(sources : 'docs/spmenu.conf', install_dir : 'share/spmenu') -install_data(sources : 'docs/spmenu_run.desktop', install_dir : 'share/applications') -install_data(sources : 'docs/spmenu_desktop.desktop', install_dir : 'share/applications') -install_data(sources : 'docs/spmenu_filemanager.desktop', install_dir : 'share/applications') -install_data(sources : 'docs/spmenu.svg', install_dir : 'share/icons/hicolor/scalable/apps') -install_data(sources : 'scripts/spmenu_run', install_dir : 'bin') -install_data(sources : 'scripts/spmenu_path', install_dir : 'bin') -install_data(sources : 'scripts/spmenu_fm', install_dir : 'bin') -install_data(sources : 'scripts/spmenu_desktop', install_dir : 'bin') -install_data(sources : 'scripts/spmenu_test', install_dir : 'bin') +if get_option('man') and get_option('docs') + install_man('spmenu.1') + install_man('spmenu_test.1') + + if get_option('run') and get_option('docs') + install_man('spmenu_run.1') + endif +endif + +if get_option('docs') + install_data(sources : 'docs/spmenu.conf', install_dir : 'share/spmenu') + install_data(sources : 'docs/spmenu_run.desktop', install_dir : 'share/applications') + install_data(sources : 'docs/spmenu_desktop.desktop', install_dir : 'share/applications') + install_data(sources : 'docs/spmenu_filemanager.desktop', install_dir : 'share/applications') + install_data(sources : 'docs/spmenu.svg', install_dir : 'share/icons/hicolor/scalable/apps') +endif + +if get_option('run') + install_data(sources : 'scripts/spmenu_run', install_dir : 'bin') + install_data(sources : 'scripts/spmenu_path', install_dir : 'bin') + install_data(sources : 'scripts/spmenu_fm', install_dir : 'bin') + install_data(sources : 'scripts/spmenu_desktop', install_dir : 'bin') +endif + +if get_option('test') + install_data(sources : 'scripts/spmenu_test', install_dir : 'bin') +endif test('spmenu', project_target) diff --git a/meson_options.txt b/meson_options.txt index 9eae2fb..6d10d9a 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -7,3 +7,7 @@ option('xresources', type : 'boolean', value : true, description : 'Enable .Xres option('fribidi', type : 'boolean', value : true, description : 'Enable Right-to-left language support') option('libconfig', type : 'boolean', value : true, description : 'Enable configuration file support') option('regex', type : 'boolean', value : true, description : 'Enable regex matching') +option('run', type : 'boolean', value : true, description : 'Install spmenu_run') +option('test', type : 'boolean', value : true, description : 'Install spmenu_test') +option('man', type : 'boolean', value : true, description : 'Install man page') +option('docs', type : 'boolean', value : true, description : 'Install documentation')