2023-12-26 15:30:10 +00:00
|
|
|
project(
|
|
|
|
'pixtool',
|
|
|
|
'cpp',
|
|
|
|
version: '0.0.0',
|
|
|
|
default_options: [
|
|
|
|
'cpp_std=c++17',
|
|
|
|
'warning_level=3'
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
2023-12-27 04:26:44 +00:00
|
|
|
data_dir = get_option('prefix') / get_option('datadir') / 'pixtool'
|
|
|
|
|
2023-12-26 15:30:10 +00:00
|
|
|
conf = configuration_data()
|
|
|
|
conf.set('version', meson.project_version())
|
2023-12-27 04:26:44 +00:00
|
|
|
conf.set('datadir', data_dir)
|
2023-12-26 15:30:10 +00:00
|
|
|
|
|
|
|
configure_file(
|
|
|
|
input: 'src/conf.in.hpp',
|
|
|
|
output: 'conf.hpp',
|
|
|
|
configuration: conf
|
|
|
|
)
|
|
|
|
|
|
|
|
qt6 = import('qt6')
|
|
|
|
qt6_dep = dependency('qt6', modules: ['Core', 'Widgets'])
|
|
|
|
|
|
|
|
qt_src = qt6.compile_moc(
|
|
|
|
headers: [
|
|
|
|
'src/gui/Window.hpp'
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
2023-12-27 04:26:44 +00:00
|
|
|
translations = qt6.compile_translations(
|
|
|
|
ts_files: [
|
|
|
|
'i18n/pix_en.ts',
|
|
|
|
'i18n/pix_fr.ts'
|
|
|
|
],
|
|
|
|
install: true,
|
|
|
|
install_dir: data_dir / 'i18n'
|
|
|
|
)
|
|
|
|
|
2023-12-26 19:22:51 +00:00
|
|
|
pixtool = static_library(
|
|
|
|
'pixtool-core',
|
2023-12-26 15:30:10 +00:00
|
|
|
sources: [
|
|
|
|
'src/Presenter.cpp',
|
|
|
|
|
|
|
|
# model
|
2023-12-26 19:22:51 +00:00
|
|
|
'src/model/PixTool.cpp',
|
|
|
|
'src/model/Command.cpp',
|
|
|
|
'src/model/Shortcut.cpp',
|
|
|
|
'src/model/CommandRunner.cpp',
|
|
|
|
'src/model/Observer.cpp',
|
|
|
|
'src/model/Observable.cpp',
|
2023-12-26 15:30:10 +00:00
|
|
|
|
|
|
|
# gui
|
|
|
|
'src/gui/Window.cpp',
|
2023-12-27 04:26:44 +00:00
|
|
|
] + qt_src + translations,
|
2023-12-26 15:30:10 +00:00
|
|
|
dependencies: [
|
2023-12-26 19:22:51 +00:00
|
|
|
qt6_dep,
|
|
|
|
dependency('spdlog')
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
pixtool_dep = declare_dependency(
|
|
|
|
link_with: [pixtool],
|
|
|
|
include_directories: ['src']
|
|
|
|
)
|
|
|
|
|
|
|
|
executable(
|
|
|
|
'pixtool',
|
|
|
|
sources: [
|
|
|
|
'src/main.cpp'
|
|
|
|
],
|
|
|
|
dependencies: [
|
|
|
|
pixtool_dep,
|
2023-12-26 15:30:10 +00:00
|
|
|
qt6_dep
|
|
|
|
],
|
|
|
|
install: true
|
|
|
|
)
|
2023-12-26 19:22:51 +00:00
|
|
|
|
|
|
|
executable(
|
|
|
|
'pixtool-tests',
|
|
|
|
sources: [
|
|
|
|
'tests/main.cpp',
|
|
|
|
'tests/CommandRunner.cpp',
|
|
|
|
],
|
|
|
|
dependencies: [
|
|
|
|
dependency('catch2'),
|
|
|
|
pixtool_dep
|
|
|
|
],
|
|
|
|
install: true
|
|
|
|
)
|