@@ -2543,6 +2543,7 @@ bin_targets = []
2543
2543
pl_targets = []
2544
2544
contrib_targets = []
2545
2545
testprep_targets = []
2546
+ nls_targets = []
2546
2547
2547
2548
2548
2549
# Define the tests to distribute them to the correct test styles later
@@ -2846,21 +2847,6 @@ generated_sources_ac += {'': ['GNUmakefile']}
2846
2847
testprep_targets += test_install_libs
2847
2848
2848
2849
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
-
2864
2850
# If there are any files in the source directory that we also generate in the
2865
2851
# build directory, they might get preferred over the newly generated files,
2866
2852
# e.g. because of a #include "file", which always will search in the current
@@ -2915,6 +2901,64 @@ endif
2915
2901
2916
2902
2917
2903
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
+
2918
2962
###############################################################
2919
2963
# Test prep
2920
2964
###############################################################
@@ -3185,6 +3229,7 @@ if meson.version().version_compare('>=0.57')
3185
3229
endif
3186
3230
3187
3231
3232
+
3188
3233
###############################################################
3189
3234
# Pseudo targets
3190
3235
###############################################################
@@ -3194,6 +3239,7 @@ alias_target('bin', bin_targets + [libpq_st])
3194
3239
alias_target (' pl' , pl_targets)
3195
3240
alias_target (' contrib' , contrib_targets)
3196
3241
alias_target (' testprep' , testprep_targets)
3242
+ alias_target (' install-world' , install_quiet, installdocs)
3197
3243
3198
3244
3199
3245
0 commit comments