Switch build system to mesonbuild.

There is no more integrated build of dependencies in the build system.
Dependencies are discovered using pkg-config except for ctpp2 where there
is no pkg-config file.
This commit is contained in:
Matthieu Gautier
2016-12-19 23:48:30 +01:00
parent 1c68cf87b9
commit 8ce1fb0ba8
42 changed files with 161 additions and 141 deletions

61
meson.build Normal file
View File

@ -0,0 +1,61 @@
project('kiwixlib', 'cpp',
version : '1.0.0',
license : 'GPL')
compiler = meson.get_compiler('cpp')
thread_dep = dependency('threads')
zlib_dep = dependency('zlib')
bzip_dep = dependency('bzip2')
libicu_dep = dependency('icu-i18n')
lzma_dep = dependency('liblzma')
libzim_dep = dependency('zimlib')
pugixml_dep = dependency('pugixml')
aria2_dep = find_program('aria2c')
ctpp2_prefix_install = get_option('ctpp2-install-prefix')
if get_option('default_library') == 'static'
libname = 'ctpp2-st'
else
libname = 'ctpp2'
endif
if ctpp2_prefix_install == ''
if not compiler.has_header('ctpp2/CTPP2Logger.hpp')
error('ctpp2/CTPP2Logger.hppnot found')
endif
ctpp2_lib = compiler.find_library(libname)
ctpp2_dep = declare_dependency(dependencies:[ctpp2_lib])
else
ctpp2_include_path = ctpp2_prefix_install + '/include'
ctpp2_include_args = ['-I'+ctpp2_include_path]
if not compiler.has_header('ctpp2/CTPP2Logger.hpp', args:ctpp2_include_args)
error('ctpp2/CTPP2Logger.hppnot found')
endif
ctpp2_include_path = include_directories(ctpp2_include_path, is_system:true)
ctpp2_lib_path = ctpp2_prefix_install+'/lib'
ctpp2_lib = compiler.find_library(libname, dirs:ctpp2_lib_path)
ctpp2_dep = declare_dependency(include_directories:ctpp2_include_path, dependencies:[ctpp2_lib])
endif
xapian_dep = dependency('xapian-core', required:false)
if xapian_dep.found()
message('xapian_dep found')
else
message('xapian_dep not found')
endif
all_deps = [thread_dep, zlib_dep, libicu_dep, lzma_dep, libzim_dep, ctpp2_dep, xapian_dep, pugixml_dep, bzip_dep]
inc = include_directories('include')
subdir('include')
subdir('src')
pkg_mod = import('pkgconfig')
pkg_mod.generate(libraries : kiwixlib,
version : '1.0',
name : 'libkiwix',
filebase : 'kiwix',
description : 'A library that contains a lot of things used by used by other kiwix programs',
requires: ['zimlib', 'zlib', 'xapian-core', 'icu-i18n', 'liblzma', 'bzip2', 'pugixml'])