You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
188 lines
6.3 KiB
188 lines
6.3 KiB
##############################################################################
|
|
# Copyright (C) 2022- Nils Hilbricht
|
|
#License for this build file. This is not the license for the software itself, which is mostly GPLv3.
|
|
#https://www.isc.org/licenses/
|
|
#
|
|
#Permission to use, copy, modify, and/or distribute this software for any purpose with or without
|
|
#fee is hereby granted, provided that the above copyright notice and this permission notice appear
|
|
#in all copies.
|
|
#
|
|
#THE SOFTWARE IS PROVIDED “AS IS” AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
|
|
#INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE
|
|
#FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
|
|
#FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
|
#ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
##############################################################################
|
|
|
|
|
|
project(
|
|
'Vjelo',
|
|
'c', 'cpp',
|
|
version : '1.0.0',
|
|
license : 'GPLv3',
|
|
default_options: [
|
|
'warning_level=2',
|
|
'optimization=3',
|
|
]
|
|
)
|
|
|
|
|
|
##############
|
|
#Subprojects
|
|
##############
|
|
|
|
liblssartifa_proj = subproject('liblssartifa')
|
|
liblssartifa_dep = liblssartifa_proj.get_variable('liblssartifa_dep')
|
|
|
|
|
|
##############
|
|
#Dependencies
|
|
##############
|
|
|
|
#If we ever do OSX, here is the GCC Call for GLFW3 etc.
|
|
#LIBS := $(GLFW3) -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo -lm -lGLEW -L/usr/local/lib
|
|
|
|
cc = meson.get_compiler('c')
|
|
|
|
dep_gl = dependency('gl')
|
|
dep_glfw = dependency('glfw3')
|
|
dep_glu = dependency('glu')
|
|
dep_glew = dependency('glew')
|
|
|
|
|
|
dep_x11 = dependency('x11')
|
|
dep_xi = dependency('xi')
|
|
dep_xcursor = dependency('xcursor')
|
|
|
|
dep_liblo = dependency('liblo') #and not 'lo'
|
|
dep_jack = dependency('jack') #and not 'libjack'
|
|
|
|
|
|
#Build dependencies
|
|
#Libraries to gather information, build manpage and documentation
|
|
#We just run them so a packager get's the info we need these programs
|
|
exe_help2man = find_program('help2man')
|
|
exe_date = find_program('date')
|
|
exe_py3 = find_program('python3')
|
|
|
|
|
|
##############
|
|
# Definitions and Information
|
|
# In this project the meson file is the central hub for information that is used in many places
|
|
# of the program and documentation, such as the name and version number.
|
|
##############
|
|
|
|
#name, version and license are in the project definition above0
|
|
tagline = 'Virtual folk instrument that bows continously.'
|
|
year = run_command(exe_date, '+%Y', check:true).stdout().strip()
|
|
author = 'Laborejo Software Suite'
|
|
url_domain = 'laborejo'
|
|
url_tld = 'org'
|
|
weburl = 'https://'+url_domain+'.'+url_tld
|
|
name_exe = meson.project_name().to_lower()
|
|
desktopFilename = '@0@.@1@.@2@.desktop'.format(url_tld, url_domain, name_exe)
|
|
|
|
##############
|
|
#Build Targets
|
|
##############
|
|
|
|
artifa_header_include = liblssartifa_proj.get_variable('liblssartifa_includes')
|
|
|
|
vjelo = executable(name_exe,
|
|
sources: [
|
|
'src/artifainterface.cpp', #meson automatically compiles and links this as cpp. We have extern C in this file as an interface to the c++ artifastring lib.
|
|
#GUI and NSM
|
|
'src/main.c',
|
|
'src/gui.c',
|
|
'src/programstate.c',
|
|
'src/nsm_callbacks.c',
|
|
'src/instrument.c',
|
|
'src/jackclient.c',
|
|
#Include unmodified copies of other source codes
|
|
'src/include/jRead.c', 'src/include/jWrite.c',
|
|
],
|
|
include_directories : artifa_header_include,
|
|
dependencies: [
|
|
liblssartifa_dep,
|
|
dep_gl, dep_glfw, dep_glu, dep_glew,
|
|
dep_liblo, dep_jack,
|
|
],
|
|
install: true, #one or more files of this target are installed during the install step
|
|
c_args : [
|
|
'-Wno-unused-variable',
|
|
'-Wno-unused-parameter',
|
|
'-Wno-maybe-uninitialized',
|
|
'-march=native',
|
|
'-ffast-math',
|
|
'-DLSS_NAME="' + meson.project_name() + '"',
|
|
'-DLSS_EXECUTABLE="' + name_exe + '"',
|
|
'-DLSS_VERSION="' + meson.project_version() + '"',
|
|
'-DLSS_YEAR="' + year + '"',
|
|
'-DLSS_TAGLINE="' + tagline + '"',
|
|
'-DLSS_AUTHOR="' + author + '"',
|
|
'-DLSS_WEBURL="' + weburl + '"',
|
|
'-DLSS_LICENSE="' + meson.project_license()[0] + '"',
|
|
],
|
|
cpp_args : [
|
|
'-Wno-unused-variable',
|
|
'-Wno-unused-parameter',
|
|
'-Wno-unused-variable',
|
|
'-Wno-unused-parameter',
|
|
'-ffast-math',
|
|
#'-mfpmath=sse', #This will choose sse1 and the program will not work!
|
|
'-DNDEBUG',
|
|
'-march=native',
|
|
'-msse2', #On my own machine this is implicit in -march=native
|
|
],
|
|
)
|
|
|
|
custom_target('manpage',
|
|
output: name_exe+'.1',
|
|
capture: true, #we could also use the --output=FILE argument of help2man
|
|
command: [exe_help2man, './vjelo',
|
|
'--no-info',
|
|
'--name='+tagline, #Name really is the description after the name. The name itself is included in any case.
|
|
'--version-string=' + meson.project_name() + ' Version ' + meson.project_version(),
|
|
'--source=' + author,
|
|
],
|
|
build_by_default: true,
|
|
build_always_stale: true,
|
|
depends: [vjelo], #build the program first, before building the manpage
|
|
install:true,
|
|
install_dir: get_option('datadir') / 'man' / 'man1'
|
|
)
|
|
|
|
|
|
#Meson is NOT ABLE to append text at the end of a file, let alone multiple lines.
|
|
#After trying for more than 4 hours I gave up. Nothing works: shell redirections >>, pipes | , sed, awk…
|
|
#The only way is to forward strings to an external script, which is a shame because that is what we wanted to avoid.
|
|
#We will use Python3 because Meson itself is Python, so at least that exists.
|
|
|
|
|
|
args = [
|
|
'Name=' + meson.project_name(),
|
|
'Icon=' + name_exe,
|
|
'Exec=' + name_exe,
|
|
'X-NSM-Exec=' + name_exe,
|
|
'Comment=' + tagline,
|
|
]
|
|
|
|
custom_target('xdg_desktop',
|
|
output: desktopFilename,
|
|
capture: true, #python just prints
|
|
command: [exe_py3,
|
|
meson.current_source_dir() / 'src' / 'createxdgdesktop.py',
|
|
'\n'.join(args),
|
|
],
|
|
build_by_default: true,
|
|
build_always_stale: true,
|
|
depends: [vjelo], #build the program first, before building the manpage
|
|
install:true,
|
|
install_dir : get_option('datadir') / 'applications'
|
|
)
|
|
|
|
|
|
##############
|
|
#Installation
|
|
##############
|
|
install_data('src/vjelo.svg', install_dir : get_option('datadir') / 'icons/hicolor/scalable/apps')
|
|
|