Skip to content

Commit

Permalink
build: Port buildsystem to meson
Browse files Browse the repository at this point in the history
  • Loading branch information
smspillaz committed Jul 6, 2018
1 parent a6debb2 commit fd57e73
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 0 deletions.
29 changes: 29 additions & 0 deletions matchers/meson.build
@@ -0,0 +1,29 @@
# /matchers/meson.build
#
# Build the mathematical_model_matcher static library.
#
# See /LICENCE.md for Copyright information.

api_version = '0.1'

mathematical_model_matcher_sources = [
'mathematical_model_matcher.h',
'mathematical_model_matcher.cpp'
]

mathematical_model_matcher_lib = static_library(
'mathematical_model_matcher',
mathematical_model_matcher_sources,
dependencies: [
gtest_project.get_variable('gtest_dep'),
gtest_project.get_variable('gmock_dep'),
wobbly_dep
],
install: false
)

mathematical_model_matcher_dep = declare_dependency(
link_with: mathematical_model_matcher_lib,
include_directories: [ include_directories('.') ],
)

19 changes: 19 additions & 0 deletions meson.build
@@ -0,0 +1,19 @@
# /meson.build
#
# Toplevel meson build file for libwobbly.
#
# See /LICENCE.md for Copyright information.

project('libwobbly', 'cpp',
version: '0.2.0',
default_options : ['cpp_std=c++17'],
license: 'MIT',
meson_version: '>= 0.40.0')

gtest_project = subproject('googletest')

wobbly_inc = include_directories('.')

subdir('wobbly')
subdir('matchers')
subdir('tests')
10 changes: 10 additions & 0 deletions subprojects/googletest.wrap
@@ -0,0 +1,10 @@
[wrap-file]
directory = googletest-release-1.8.0

source_url = https://github.com/google/googletest/archive/release-1.8.0.zip
source_filename = gtest-1.8.0.zip
source_hash = f3ed3b58511efd272eb074a3a6d6fb79d7c2e6a0e374323d1e6bcbcc1ef141bf

patch_url = https://wrapdb.mesonbuild.com/v1/projects/gtest/1.8.0/5/get_zip
patch_filename = gtest-1.8.0-5-wrap.zip
patch_hash = 7eeaede4aa2610a403313b74e04baf91ccfbaef03203d8f56312e22df1834ec5
30 changes: 30 additions & 0 deletions tests/meson.build
@@ -0,0 +1,30 @@
# /matchers/meson.build
#
# Build the libwobbly unit tests.
#
# See /LICENCE.md for Copyright information.

wobbly_test_sources = [
'anchor_test.cpp',
'constrainment_test.cpp',
'euler_integration_test.cpp',
'mesh_interpolation_test.cpp',
'model_test.cpp',
'ostream_point_operator.h',
'point_test.cpp',
'spring_test.cpp'
]

wobbly_test_executable = executable(
'windowfx_wobbly_test',
wobbly_test_sources,
dependencies: [
gtest_project.get_variable('gtest_main_dep'),
gtest_project.get_variable('gtest_dep'),
gtest_project.get_variable('gmock_dep'),
mathematical_model_matcher_dep,
wobbly_dep
]
)

test('windowfx_wobbly_test', wobbly_test_executable)
43 changes: 43 additions & 0 deletions wobbly/meson.build
@@ -0,0 +1,43 @@
# /wobbly/meson.build
#
# Build the libwobbly library.
#
# See /LICENCE.md for Copyright information.

api_version = '0.3'

wobbly_sources = [
'wobbly_internal.h',
'wobbly.cpp'
]

wobbly_headers = [
'geometry.h',
'geometry_traits.h',
'wobbly.h'
]

wobbly_lib = shared_library(
'windowfx_wobbly',
wobbly_sources,
soversion: api_version,
install: true,
include_directories: [ wobbly_inc ]
)

install_headers(wobbly_headers, subdir: 'wobbly')

wobbly_dep = declare_dependency(
link_with: wobbly_lib,
include_directories: [ wobbly_inc ],
)

pkg = import('pkgconfig')
pkg.generate(
description: 'Library to provide a spring-controlled bezier mesh',
name: 'libwindowfx_wobbly',
filebase: 'libwindowfx_wobbly-' + api_version,
version: meson.project_version(),
libraries: wobbly_lib,
install_dir: join_paths(get_option('libdir'), 'pkgconfig')
)

0 comments on commit fd57e73

Please sign in to comment.