@@ -7,7 +7,7 @@ project('libxml++', 'cpp',
7
7
' warning_level=1' ,
8
8
' cpp_std=c++17' ,
9
9
],
10
- meson_version : ' >= 0.60 .0' , # required for dependency('iconv' )
10
+ meson_version : ' >= 0.62 .0' , # required for variables in pkgconfig.generate( )
11
11
)
12
12
13
13
xmlxx_api_version = ' 5.0'
@@ -113,22 +113,20 @@ xml2_dep = dependency(
113
113
fallback : [' libxml2' ]
114
114
)
115
115
116
- xmlxx_requires = []
117
- libxml2_lib_pkgconfig = ''
116
+ xmlxx_pc_requires = []
117
+ libxml2_lib_pkgconfig = []
118
118
119
119
# Put libxml-2.0 in the 'Requires:' section in the generated pkg-config file if
120
120
# we found it by pkg-config
121
121
if xml2_dep.type_name() == ' pkgconfig' or xml2_dep.type_name() == ' internal'
122
- xmlxx_requires += [' libxml-2.0' , xml2_req]
122
+ xmlxx_pc_requires += [' libxml-2.0' + xml2_req]
123
123
else
124
- libxml2_lib_pkgconfig = xml2_dep.get_variable (
124
+ libxml2_lib_pkgconfig += [ xml2_dep.get_variable (
125
125
cmake : ' LIBXML2_LIBRARIES' ,
126
126
default_value : ' LibXml2.lib' ,
127
- )
127
+ )]
128
128
endif
129
129
130
- xmlxx_requires = ' ' .join(xmlxx_requires)
131
-
132
130
# Make sure we link to libxml-2.0
133
131
xmlxx_build_dep = [xml2_dep]
134
132
@@ -270,20 +268,8 @@ endif
270
268
271
269
# Configure files
272
270
pkg_conf_data = configuration_data ()
273
- pkg_conf_data.set(' prefix' , install_prefix)
274
- pkg_conf_data.set(' exec_prefix' , ' ${prefix}' )
275
- pkg_conf_data.set(' libdir' , ' ${exec_prefix}' / install_libdir)
276
- pkg_conf_data.set(' datarootdir' , ' ${prefix}' / install_datadir)
277
- pkg_conf_data.set(' datadir' , ' ${datarootdir}' )
278
- pkg_conf_data.set(' includedir' , ' ${prefix}' / install_includedir)
279
271
pkg_conf_data.set(' PACKAGE_NAME' , meson .project_name()) # MSVC_NMake/libxml++/libxml++.rc
280
- pkg_conf_data.set(' PACKAGE_TARNAME' , meson .project_name())
281
272
pkg_conf_data.set(' PACKAGE_VERSION' , meson .project_version())
282
- pkg_conf_data.set(' LIBXMLXX_MODULE_NAME' , xmlxx_pcname)
283
- pkg_conf_data.set(' LIBXMLXX_API_VERSION' , xmlxx_api_version)
284
- pkg_conf_data.set(' LIBXMLXX_MODULES' , xmlxx_requires)
285
- pkg_conf_data.set(' LIBXML2_LIB_NO_PKGCONFIG' , libxml2_lib_pkgconfig)
286
- pkg_conf_data.set(' MSVC_TOOLSET_VER' , msvc14x_toolset_ver)
287
273
288
274
if not build_deprecated_api
289
275
pkg_conf_data.set(' LIBXMLXX_DISABLE_DEPRECATED' , 1 )
@@ -308,13 +294,6 @@ if cpp_compiler.get_argument_syntax() == 'msvc'
308
294
endif
309
295
endif
310
296
311
- configure_file (
312
- input : ' libxml++.pc.in' ,
313
- output : xmlxx_pcname + ' .pc' ,
314
- configuration : pkg_conf_data,
315
- install_dir : install_pkgconfigdir,
316
- )
317
-
318
297
xmlxxconfig_h_meson = files (' libxml++config.h.meson' )
319
298
install_includeconfigdir = install_libdir / xmlxx_pcname / ' include'
320
299
configure_file (
@@ -324,36 +303,31 @@ configure_file(
324
303
install_dir : install_includeconfigdir,
325
304
)
326
305
327
- # add_dist_script() is not allowed in a subproject if meson.version() < 0.58.0.
328
- can_add_dist_script = not meson .is_subproject() or meson .version().version_compare(' >= 0.58.0' )
329
-
330
306
subdir (' MSVC_NMake/libxml++' )
331
307
subdir (' libxml++' )
332
308
subdir (' examples' )
333
309
subdir (' tests' )
334
310
subdir (' docs/reference' )
335
311
subdir (' docs/manual' )
336
312
337
- if can_add_dist_script
338
- # Add a ChangeLog file to the distribution directory.
339
- meson .add_dist_script(
340
- python3, dist_changelog_py,
341
- project_source_root,
342
- )
313
+ # Add a ChangeLog file to the distribution directory.
314
+ meson .add_dist_script(
315
+ python3, dist_changelog_py,
316
+ project_source_root,
317
+ )
343
318
344
- # Don't distribute these files and directories.
345
- dont_distribute = [
346
- ' .github' ,
347
- ]
348
- # Add build scripts to the distribution directory, and delete .gitignore
349
- # files and an empty $MESON_PROJECT_DIST_ROOT/build/ directory.
350
- meson .add_dist_script(
351
- python3, dist_build_scripts_py,
352
- project_source_root,
353
- ' untracked' / ' build_scripts' ,
354
- dont_distribute,
355
- )
356
- endif
319
+ # Don't distribute these files and directories.
320
+ dont_distribute = [
321
+ ' .github' ,
322
+ ]
323
+ # Add build scripts to the distribution directory, and delete .gitignore
324
+ # files and an empty $MESON_PROJECT_DIST_ROOT/build/ directory.
325
+ meson .add_dist_script(
326
+ python3, dist_build_scripts_py,
327
+ project_source_root,
328
+ ' untracked' / ' build_scripts' ,
329
+ dont_distribute,
330
+ )
357
331
358
332
if meson .is_subproject()
359
333
pkgconfig_vars = {
0 commit comments