King_DuckZ
27a5f00ea4
When you code, you should probably configure with -Dscript_path=$HOME/your/code/dir, and doing this now prevents the script files from being copied over to the install dir. This is correct because in this case source dir == dest dir. If you want to really install the program, you should set script_path to a relative path or a different directory than the source. For example -Dscript_path=duckticker/script. ninja install will copy the script files to the install directory in this case. Note that the path to the script directory that gets compiled into the binary is an absolute path in either case. This means that "roaming app" mode is not currently supported. The reason for this is that I need code to detect the binary directory so that relative script paths can work, but I don't have that code right now.
25 lines
919 B
Meson
25 lines
919 B
Meson
project('duckticker', 'cpp',
|
|
version: '0.1.0',
|
|
meson_version: '>=0.55.0',
|
|
default_options: ['buildtype=debug', 'cpp_std=c++20', 'b_ndebug=if-release'],
|
|
license: 'GPL3+',
|
|
)
|
|
|
|
compiler_opts = ['-DWRENPP_WITH_NAME_GUESSING']
|
|
|
|
full_data_dir = get_option('prefix') / get_option('datadir')
|
|
full_script_dir = full_data_dir / get_option('script_path') / ''
|
|
|
|
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', full_script_dir)
|
|
|
|
subdir('src')
|
|
|
|
if not get_option('script_path').startswith(meson.project_source_root())
|
|
install_data(sources: 'script/main.wren', install_dir: get_option('script_path'))
|
|
endif
|