Merge pull request #344 from FluidSynth/cmake-static

minor cmake fixes
This commit is contained in:
Tom M 2018-02-24 16:46:06 +01:00 committed by GitHub
commit ba2c0537c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 62 additions and 105 deletions

View file

@ -6,6 +6,7 @@ env:
- CMAKE_FLAGS="-Denable-floats=1 -Denable-profiling=1"
- CMAKE_FLAGS="-Denable-trap-on-fpe=1"
- CMAKE_FLAGS="-Denable-fpe-check=1"
- CMAKE_FLAGS="-DBUILD_SHARED_LIBS=0"
matrix:
include:
- os: linux
@ -191,8 +192,10 @@ before_install:
- eval "${MATRIX_EVAL}"
before_script:
- mkdir $HOME/fluidsynth_install/
- mkdir build && cd build
script:
- cmake ${CMAKE_FLAGS} "-Denable-portaudio=1" "-Denable-ladspa=1" "-DCMAKE_BUILD_TYPE=RelWithDebInfo" ..
- cmake -DCMAKE_INSTALL_PREFIX=$HOME/fluidsynth_install ${CMAKE_FLAGS} "-Denable-portaudio=1" "-Denable-ladspa=1" "-DCMAKE_BUILD_TYPE=RelWithDebInfo" ..
- make -j4
- if [ $TRAVIS_OS_NAME = linux ]; then make install; fi # install only on linux, as CMAKE_INSTALL_PREFIX is ignored for frameworks on macosx and I cant tell whether that's correct or a bug

View file

@ -224,7 +224,7 @@ unset ( MACOSX_FRAMEWORK CACHE )
if ( CMAKE_SYSTEM MATCHES "Darwin" )
set ( DARWIN 1 )
set ( CMAKE_INSTALL_NAME_DIR
${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}${LIB_SUFFIX} )
${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR} )
if ( enable-coreaudio )
check_include_file ( CoreAudio/AudioHardware.h COREAUDIO_FOUND )
if ( COREAUDIO_FOUND )
@ -451,22 +451,20 @@ endif ( enable-readline )
# General configuration file
configure_file ( ${CMAKE_SOURCE_DIR}/src/config.cmake
${CMAKE_BINARY_DIR}/config.h )
add_definitions ( -DHAVE_CONFIG_H )
# Process subdirectories
add_subdirectory ( src )
add_subdirectory ( include )
add_subdirectory ( doc )
# pkg-config support
set ( prefix "${CMAKE_INSTALL_PREFIX}" )
set ( exec_prefix "\${prefix}" )
set ( libdir "\${exec_prefix}/${LIB_INSTALL_DIR}${LIB_SUFFIX}" )
set ( libdir "\${exec_prefix}/${LIB_INSTALL_DIR}" )
set ( includedir "\${prefix}/${INCLUDE_INSTALL_DIR}" )
configure_file ( fluidsynth.pc.in
${CMAKE_BINARY_DIR}/fluidsynth.pc IMMEDIATE @ONLY )
install ( FILES ${CMAKE_BINARY_DIR}/fluidsynth.pc
DESTINATION ${LIB_INSTALL_DIR}${LIB_SUFFIX}/pkgconfig )
DESTINATION ${LIB_INSTALL_DIR}/pkgconfig )
# Extra targets for Unix build environments
if ( UNIX )
@ -474,6 +472,15 @@ if ( UNIX )
configure_file ( fluidsynth.spec.in
${CMAKE_BINARY_DIR}/fluidsynth.spec IMMEDIATE @ONLY )
if ( DEFINED FLUID_DAEMON_ENV_FILE)
configure_file ( fluidsynth.service.in
${CMAKE_BINARY_DIR}/fluidsynth.service @ONLY )
configure_file ( fluidsynth.conf.in
${CMAKE_BINARY_DIR}/fluidsynth.conf @ONLY )
endif ( DEFINED FLUID_DAEMON_ENV_FILE )
# uninstall custom target
configure_file ( "${CMAKE_SOURCE_DIR}/cmake_admin/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY)

View file

@ -31,7 +31,7 @@ set (SBIN_INSTALL_DIR "sbin" CACHE STRING
mark_as_advanced (SBIN_INSTALL_DIR)
# LIB_INSTALL_DIR - the directory where libraries will be installed
set (LIB_INSTALL_DIR "lib" CACHE STRING "The install dir for libraries")
set (LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE STRING "The install dir for libraries")
mark_as_advanced (LIB_INSTALL_DIR)
# INCLUDE_INSTALL_DIR - the install dir for header files

5
fluidsynth.conf.in Normal file
View file

@ -0,0 +1,5 @@
# Mandatory parameters (uncomment and edit)
#SOUND_FONT=@DEFAULT_SOUNDFONT@
# Additional optional parameters (may be useful, see 'man fluidsynth' for further info)
#OTHER_OPTS='-a alsa -m alsa_seq -r 48000'

13
fluidsynth.service.in Normal file
View file

@ -0,0 +1,13 @@
[Unit]
Description=FluidSynth Daemon
Documentation=man:fluidsynth(1)
After=sound.target
[Service]
EnvironmentFile=@FLUID_DAEMON_ENV_FILE@
EnvironmentFile=-%h/.config/fluidsynth
ExecStart=@CMAKE_INSTALL_PREFIX@/@BIN_INSTALL_DIR@/fluidsynth -is $OTHER_OPTS $SOUND_FONT
[Install]
WantedBy=multi-user.target

View file

@ -1,26 +0,0 @@
# FluidSynth - A Software Synthesize
#
# Copyright (C) 2003-2010 Peter Hanappe and others.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either version 2.1 of
# the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# 02111-1307, USA
# CMake based build system. Pedro Lopez-Cabanillas <plcl@users.sf.net>
add_subdirectory ( fluidsynth )
IF (NOT MACOSX_FRAMEWORK )
install ( FILES fluidsynth.h DESTINATION ${INCLUDE_INSTALL_DIR} )
ENDIF (NOT MACOSX_FRAMEWORK )

View file

@ -27,24 +27,29 @@
extern "C" {
#endif
#if defined(WIN32)
#if defined(FLUIDSYNTH_DLL_EXPORTS)
#define FLUIDSYNTH_API __declspec(dllexport)
#elif defined(FLUIDSYNTH_NOT_A_DLL)
#define FLUIDSYNTH_API
#else
#define FLUIDSYNTH_API __declspec(dllimport)
#endif
#cmakedefine01 BUILD_SHARED_LIBS
#if (BUILD_SHARED_LIBS == 0)
#define FLUIDSYNTH_API // building static lib? no visibility control then
#elif defined(WIN32)
#if defined(FLUIDSYNTH_NOT_A_DLL)
#define FLUIDSYNTH_API
#elif defined(FLUIDSYNTH_DLL_EXPORTS)
#define FLUIDSYNTH_API __declspec(dllexport)
#else
#define FLUIDSYNTH_API __declspec(dllimport)
#endif
#elif defined(MACOS9)
#define FLUIDSYNTH_API __declspec(export)
#elif defined(__GNUC__)
#define FLUIDSYNTH_API __attribute__ ((visibility ("default")))
#else
#define FLUIDSYNTH_API
#endif
#endif
#if defined(__GNUC__) || defined(__clang__)
# define FLUID_DEPRECATED __attribute__((deprecated))

View file

@ -1,52 +0,0 @@
# FluidSynth - A Software Synthesize
#
# Copyright (C) 2003-2010 Peter Hanappe and others.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either version 2.1 of
# the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# 02111-1307, USA
# CMake based build system. Pedro Lopez-Cabanillas <plcl@users.sf.net>
configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/version.h.in
${CMAKE_CURRENT_BINARY_DIR}/version.h )
if ( NOT MACOSX_FRAMEWORK )
set ( include_HEADERS
audio.h
event.h
gen.h
ladspa.h
log.h
midi.h
misc.h
mod.h
ramsfont.h
seq.h
seqbind.h
settings.h
sfont.h
shell.h
synth.h
types.h
voice.h
)
install (
FILES
${include_HEADERS}
${CMAKE_CURRENT_BINARY_DIR}/version.h
DESTINATION
${INCLUDE_INSTALL_DIR}/fluidsynth
)
endif ( NOT MACOSX_FRAMEWORK )

View file

@ -201,9 +201,14 @@ set ( public_HEADERS
)
set ( public_main_HEADER
${CMAKE_SOURCE_DIR}/include/fluidsynth.h
${CMAKE_BINARY_DIR}/include/fluidsynth.h
)
configure_file ( ${CMAKE_SOURCE_DIR}/include/fluidsynth/version.h.in
${CMAKE_BINARY_DIR}/include/fluidsynth/version.h )
configure_file ( ${CMAKE_SOURCE_DIR}/include/fluidsynth.cmake
${public_main_HEADER} )
if ( WIN32 AND NOT MINGW )
include(generate_product_version)
generate_product_version(
@ -280,6 +285,7 @@ if ( MACOSX_FRAMEWORK )
elseif ( OS2 )
set_target_properties ( libfluidsynth
PROPERTIES
PUBLIC_HEADER "${public_HEADERS}"
OUTPUT_NAME "fluidsynth"
VERSION ${LIB_VERSION_INFO}
SOVERSION ${LIB_VERSION_CURRENT}
@ -287,6 +293,7 @@ elseif ( OS2 )
elseif ( WIN32 )
set_target_properties ( libfluidsynth
PROPERTIES
PUBLIC_HEADER "${public_HEADERS}"
ARCHIVE_OUTPUT_NAME "fluidsynth"
PREFIX "lib"
OUTPUT_NAME "fluidsynth-${LIB_VERSION_CURRENT}"
@ -296,6 +303,7 @@ elseif ( WIN32 )
else ( MACOSX_FRAMEWORK )
set_target_properties ( libfluidsynth
PROPERTIES
PUBLIC_HEADER "${public_HEADERS}"
PREFIX "lib"
OUTPUT_NAME "fluidsynth"
VERSION ${LIB_VERSION_INFO}
@ -353,8 +361,10 @@ if ( MACOSX_FRAMEWORK )
else ( MACOSX_FRAMEWORK )
install ( TARGETS fluidsynth libfluidsynth
RUNTIME DESTINATION ${BIN_INSTALL_DIR}
LIBRARY DESTINATION ${LIB_INSTALL_DIR}${LIB_SUFFIX}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}${LIB_SUFFIX}
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
PUBLIC_HEADER DESTINATION ${INCLUDE_INSTALL_DIR}/fluidsynth
)
install ( FILES ${public_main_HEADER} DESTINATION ${INCLUDE_INSTALL_DIR} )
endif ( MACOSX_FRAMEWORK )

View file

@ -17,9 +17,7 @@
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
#if defined(HAVE_LASH)

View file

@ -18,9 +18,7 @@
* 02110-1301, USA
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>

View file

@ -22,9 +22,7 @@
#ifndef _FLUID_PHASE_H
#define _FLUID_PHASE_H
#if HAVE_CONFIG_H
#include "config.h"
#endif
/*
* phase

View file

@ -24,9 +24,7 @@
#include <glib.h>
#if HAVE_CONFIG_H
#include "config.h"
#endif
#if defined(__POWERPC__) && !(defined(__APPLE__) && defined(__MACH__))
#include "config_maxmsp43.h"