@@ -2543,6 +2543,7 @@ bin_targets = []
25432543pl_targets = []
25442544contrib_targets = []
25452545testprep_targets = []
2546+ nls_targets = []
25462547
25472548
25482549# Define the tests to distribute them to the correct test styles later
@@ -2846,21 +2847,6 @@ generated_sources_ac += {'': ['GNUmakefile']}
28462847testprep_targets += test_install_libs
28472848
28482849
2849- # command to install files used for tests, which aren't installed by default
2850- install_test_files_args = [
2851- install_files,
2852- ' --prefix' , dir_prefix,
2853- ' --install' , contrib_data_dir, test_install_data,
2854- ' --install' , dir_lib_pkg, test_install_libs,
2855- ]
2856-
2857- # Target installing files required for installcheck of various modules
2858- run_target (' install-test-files' ,
2859- command : [python] + install_test_files_args,
2860- depends : testprep_targets,
2861- )
2862-
2863-
28642850# If there are any files in the source directory that we also generate in the
28652851# build directory, they might get preferred over the newly generated files,
28662852# e.g. because of a #include "file", which always will search in the current
@@ -2915,6 +2901,64 @@ endif
29152901
29162902
29172903
2904+ ###############################################################
2905+ # Install targets
2906+ ###############################################################
2907+
2908+
2909+ # We want to define additional install targets beyond what meson provides. For
2910+ # that we need to define targets depending on nearly everything. We collected
2911+ # the results of i18n.gettext() invocations into nls_targets, that also
2912+ # includes maintainer targets though. Collect the ones we want as a dependency.
2913+ #
2914+ # i18n.gettext() doesn't return the dependencies before 0.60 - but the gettext
2915+ # generation happens during install, so that's not a real issue.
2916+ nls_mo_targets = []
2917+ if libintl.found() and meson .version().version_compare(' >=0.60' )
2918+ # use range() to avoid the flattening of the list that forech() would do
2919+ foreach off : range(0 , nls_targets.length())
2920+ # i18n.gettext() list containing 1) list of built .mo files 2) maintainer
2921+ # -pot target 3) maintainer -pot target
2922+ nls_mo_targets += nls_targets[off][0 ]
2923+ endforeach
2924+ alias_target (' nls' , nls_mo_targets)
2925+ endif
2926+
2927+
2928+ all_built = [
2929+ backend_targets,
2930+ bin_targets,
2931+ libpq_st,
2932+ pl_targets,
2933+ contrib_targets,
2934+ nls_mo_targets,
2935+ testprep_targets,
2936+ ecpg_targets,
2937+ ]
2938+
2939+ # Meson's default install target is quite verbose. Provide one that is quiet.
2940+ install_quiet = custom_target (' install-quiet' ,
2941+ output : ' install-quiet' ,
2942+ build_always_stale : true ,
2943+ build_by_default : false ,
2944+ command : meson_args + [' install' , ' --quiet' , ' --no-rebuild' ],
2945+ depends : all_built,
2946+ )
2947+
2948+ # Target to install files used for tests, which aren't installed by default
2949+ install_test_files_args = [
2950+ install_files,
2951+ ' --prefix' , dir_prefix,
2952+ ' --install' , contrib_data_dir, test_install_data,
2953+ ' --install' , dir_lib_pkg, test_install_libs,
2954+ ]
2955+ run_target (' install-test-files' ,
2956+ command : [python] + install_test_files_args,
2957+ depends : testprep_targets,
2958+ )
2959+
2960+
2961+
29182962###############################################################
29192963# Test prep
29202964###############################################################
@@ -3185,6 +3229,7 @@ if meson.version().version_compare('>=0.57')
31853229endif
31863230
31873231
3232+
31883233###############################################################
31893234# Pseudo targets
31903235###############################################################
@@ -3194,6 +3239,7 @@ alias_target('bin', bin_targets + [libpq_st])
31943239alias_target (' pl' , pl_targets)
31953240alias_target (' contrib' , contrib_targets)
31963241alias_target (' testprep' , testprep_targets)
3242+ alias_target (' install-world' , install_quiet, installdocs)
31973243
31983244
31993245
0 commit comments