meson: improve/fix previous commit from MR !725.
- Setting an exec_dir variable is an error. As meson docs says, if
relative, it is installed relatively to prefix anyway: "If this is a
relative path, it is assumed to be relative to the prefix."
On the other hand, it would make problems if someone tried to set an
absolute bindir.
Moreover it is a lot clearer now. When we want to install in the
binary directory unconditionally, then get_option('bindir') is the
meson way, hence the way to go.
- On the other hand, the `gimp-debug-tool` is installed either in bindir
for Windows or macOS and libexecdir for all other platforms, at least
that's how it's set in the autotools build. So let's keep both builds
consistent.
- Make a hopefully clearer description for enable-default-bin option.
Let's clarify this is just about creating unversionning links pointing
to versionned files.
- Adding an item in the "Optional Features" part of the summary listing
during meson configure, for better discovery.
For the ".exe" extension on Windows, I wished we had an $(EXEEXT)
equivalent on meson rather than trying to set it ourselves (are there
other platforms where we must set a different extension?). But I could
not find any.
2022-08-29 18:39:49 +08:00
|
|
|
if platform_windows or platform_osx
|
|
|
|
gimp_debug_tool_dir = get_option('bindir')
|
|
|
|
else
|
|
|
|
gimp_debug_tool_dir = get_option('libexecdir')
|
|
|
|
endif
|
|
|
|
|
2017-11-01 21:27:13 +08:00
|
|
|
|
2022-08-31 21:10:13 +08:00
|
|
|
gimp_debug_tool = executable('gimp-debug-tool' + exec_ver,
|
2017-11-01 21:27:13 +08:00
|
|
|
'gimp-debug-tool.c',
|
|
|
|
include_directories: rootInclude,
|
|
|
|
dependencies: [
|
|
|
|
fontconfig,
|
|
|
|
gio,
|
|
|
|
gegl,
|
|
|
|
gtk3,
|
|
|
|
],
|
|
|
|
link_with: [
|
|
|
|
libapp,
|
|
|
|
libappwidgets,
|
2020-02-14 07:03:32 +08:00
|
|
|
libgimpbase,
|
2017-11-01 21:27:13 +08:00
|
|
|
],
|
2019-12-30 07:21:33 +08:00
|
|
|
install: true,
|
meson: improve/fix previous commit from MR !725.
- Setting an exec_dir variable is an error. As meson docs says, if
relative, it is installed relatively to prefix anyway: "If this is a
relative path, it is assumed to be relative to the prefix."
On the other hand, it would make problems if someone tried to set an
absolute bindir.
Moreover it is a lot clearer now. When we want to install in the
binary directory unconditionally, then get_option('bindir') is the
meson way, hence the way to go.
- On the other hand, the `gimp-debug-tool` is installed either in bindir
for Windows or macOS and libexecdir for all other platforms, at least
that's how it's set in the autotools build. So let's keep both builds
consistent.
- Make a hopefully clearer description for enable-default-bin option.
Let's clarify this is just about creating unversionning links pointing
to versionned files.
- Adding an item in the "Optional Features" part of the summary listing
during meson configure, for better discovery.
For the ".exe" extension on Windows, I wished we had an $(EXEEXT)
equivalent on meson rather than trying to set it ourselves (are there
other platforms where we must set a different extension?). But I could
not find any.
2022-08-29 18:39:49 +08:00
|
|
|
install_dir: gimp_debug_tool_dir
|
2017-11-01 21:27:13 +08:00
|
|
|
)
|
2022-08-29 21:41:08 +08:00
|
|
|
|
2024-06-05 20:40:30 +08:00
|
|
|
if enable_default_bin
|
|
|
|
if not platform_windows
|
|
|
|
install_symlink(fs.name(gimp_debug_tool.full_path()).replace(exec_ver, ''),
|
|
|
|
pointing_to: fs.name(gimp_debug_tool.full_path()),
|
|
|
|
install_dir: gimp_debug_tool_dir
|
|
|
|
)
|
|
|
|
else
|
|
|
|
meson.add_install_script('sh', '-c',
|
|
|
|
'cp -f "@0@" "$MESON_INSTALL_DESTDIR_PREFIX/bin/@1@"'.format((gimp_debug_tool.full_path()), fs.name(gimp_debug_tool.name()).replace(exec_ver, '.exe')))
|
|
|
|
endif
|
2022-08-29 21:41:08 +08:00
|
|
|
endif
|