Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
meson.build 2.93 KiB
project('harbour-spoon', 'cpp', default_options: ['cpp_std=c++14', 'b_pie=true'])

qt5 = import('qt5')
qt5_dep = dependency('qt5', modules: ['Core', 'Qml', 'Quick'])
inc = include_directories('src')

cmake_pref = get_option('cget_prefix')

boost_dep = dependency('boost', modules : [
	'atomic',
	'chrono',
	'date_time',
	'iostreams',
	'random',
	'regex',
	'system',
	'thread'
	], static: true)
zlib_dep = dependency('zlib')
olm_dep = dependency('Olm', method : 'cmake', cmake_module_path : cmake_pref + '/Olm', static: true)
matrix_dep = dependency('MatrixClient', method : 'cmake', cmake_module_path : cmake_pref + '/MatrixClient', static: true)
json_dep = dependency('nlohmann_json', method : 'cmake', modules : ['nlohmann_json::nlohmann_json'], cmake_module_path : cmake_pref + '/nlohmann_json', static: true)
ssl_dep = dependency('OpenSSL', static: true)
sailfish_dep = dependency('sailfishapp')
#networkstate_dep = dependency('statefs-qt5')
networkstate_dep = dependency('contextkit-statefs')
threads_dep = dependency('threads')

deps = [qt5_dep, zlib_dep, olm_dep, matrix_dep, json_dep, ssl_dep, sailfish_dep, threads_dep, boost_dep, networkstate_dep]
defines = ['-DBOOST_MPL_LIMIT_LIST_SIZE=30', '-DBOOST_MPL_CFG_NO_PREPROCESSED_HEADERS=1', '-DBOOST_ASIO_DISABLE_EPOLL']

moc_files = qt5.preprocess(moc_headers :
	[
		'src/client.h',
		'src/debug_out.h',
		'src/login.h',
		'src/settings.h',
		'src/sync.h',
		'src/mxcimageprovider.h',
        'src/mxcdownloader.h',
		'src/models/roommodel.h',
		'src/models/roomlistmodel.h'
	],
	moc_extra_arguments: defines, include_directories: inc,
	dependencies: deps)

sources = [
    'src/harbour-spoon.cpp',
    'src/client.cpp',
    'src/debug_out.cpp',
    'src/login.cpp',
    'src/settings.cpp',
    'src/sync.cpp',
    'src/mxcimageprovider.cpp',
    'src/mxcdownloader.cpp',
    'src/models/roommodel.cpp',
    'src/models/roomlistmodel.cpp'
    ]

translations = qt5.compile_translations(ts_files : ['translations/harbour-spoon.ts', 'translations/harbour-spoon-de.ts'], build_by_default : true, install: true, install_dir: 'share/harbour-spoon/translations')
executable('harbour-spoon',
	sources, moc_files,
	include_directories: inc,
	dependencies : deps,
	cpp_args : defines,
    install_rpath: '/usr/share/harbour-spoon/lib',
	install: true)

install_subdir('qml', install_dir: 'share/harbour-spoon')
install_data('harbour-spoon.desktop', install_dir: 'share/applications')


install_data('harbour-spoon.desktop',
	install_dir: 'share/applications')

install_data('icons/86x86/harbour-spoon.png',
	install_dir: 'share/icons/hicolor/86x86/apps')

install_data('icons/108x108/harbour-spoon.png',
	install_dir: 'share/icons/hicolor/108x108/apps')

install_data('icons/128x128/harbour-spoon.png',
	install_dir: 'share/icons/hicolor/128x128/apps')

#install_data('icons/256x256/harbour-spoon.png',
#	install_dir: 'share/icons/hicolor/256x256/apps')

install_data('icons/172x172/harbour-spoon.png',
	install_dir: 'share/icons/hicolor/172x172/apps')