Mac OSX fixes: frameworks build, midi.coremidi.id option.

This commit is contained in:
Pedro Lopez-Cabanillas 2010-10-31 16:15:32 +00:00
parent 068a7534ef
commit 155e43760e
4 changed files with 226 additions and 209 deletions

View file

@ -1,4 +1,4 @@
# FluidSynth - A Software Synthesize
# FluidSynth - A Software Synthesizer
#
# Copyright (C) 2003-2010 Peter Hanappe and others.
#

View file

@ -1,4 +1,4 @@
# FluidSynth - A Software Synthesize
# FluidSynth - A Software Synthesizer
#
# Copyright (C) 2003-2010 Peter Hanappe and others.
#
@ -107,6 +107,13 @@ if ( MIDISHARE_SUPPORT )
include_directories ( ${MidiShare_INCLUDE_DIRS} )
endif ( MIDISHARE_SUPPORT )
set ( config_SOURCES ${CMAKE_BINARY_DIR}/config.h )
if ( MSVC )
set ( config_SOURCES
${config_SOURCES}
${CMAKE_BINARY_DIR}/config_win32.h )
endif ( MSVC )
set ( libfluidsynth_SOURCES
utils/fluid_conv.c
utils/fluid_conv.h
@ -224,6 +231,7 @@ link_directories (
# note: by default this target creates a shared object (or dll). To build a
# static library instead, set the option BUILD_SHARED_LIBS to FALSE.
add_library ( libfluidsynth
${config_SOURCES}
${fluid_alsa_SOURCES}
${fluid_coreaudio_SOURCES}
${fluid_coremidi_SOURCES}
@ -252,7 +260,7 @@ if ( MACOSX_FRAMEWORK )
FRAMEWORK TRUE
PUBLIC_HEADER "${public_main_HEADER}"
FRAMEWORK_VERSION "${LIB_VERSION_CURRENT}"
INSTALL_NAME_DIR ${FRAMEWORK_INSTALL_DIR}
INSTALL_NAME_DIR ""
VERSION ${LIB_VERSION_INFO}
SOVERSION ${LIB_VERSION_CURRENT}
)
@ -308,10 +316,16 @@ target_link_libraries ( fluidsynth
${FLUID_LIBS}
)
if ( MACOSX_FRAMEWORK )
install ( TARGETS fluidsynth libfluidsynth
RUNTIME DESTINATION ${BIN_INSTALL_DIR}
FRAMEWORK DESTINATION ${FRAMEWORK_INSTALL_DIR}
)
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}
FRAMEWORK DESTINATION ${FRAMEWORK_INSTALL_DIR}
BUNDLE DESTINATION ${BUNDLE_INSTALL_DIR}
)
endif ( MACOSX_FRAMEWORK )

View file

@ -78,6 +78,7 @@ new_fluid_coremidi_driver(fluid_settings_t* settings, handle_midi_event_func_t h
fluid_coremidi_driver_t* dev;
MIDIClientRef client;
MIDIEndpointRef endpoint;
char clientid[32];
char * portname;
char * id;
CFStringRef str_portname;
@ -108,21 +109,23 @@ new_fluid_coremidi_driver(fluid_settings_t* settings, handle_midi_event_func_t h
}
fluid_settings_dupstr(settings, "midi.coremidi.id", &id); /* ++ alloc id string */
if (!id || FLUID_STRCMP(id, "pid") == 0)
bzero (clientid, sizeof(clientid));
if (id != NULL) {
if (FLUID_STRCMP (id, "pid") == 0) {
snprintf (clientid, sizeof(clientid), " (%d)", getpid());
} else {
snprintf (clientid, sizeof(clientid), " (%s)", id);
}
FLUID_FREE (id); /* -- free id string */
}
str_clientname = CFStringCreateWithFormat (NULL, NULL,
CFSTR("FluidSynth %qi"),
(long long) getpid());
else
str_clientname = CFStringCreateWithFormat(NULL, NULL,
CFSTR("FluidSynth %s"), id);
if (id) FLUID_FREE (id); /* -- free id string */
CFSTR("FluidSynth%s"), clientid);
fluid_settings_dupstr(settings, "midi.portname", &portname); /* ++ alloc port name */
if (!portname || strlen(portname) == 0)
str_portname = CFStringCreateWithFormat (NULL, NULL,
CFSTR("FluidSynth virtual port %qi"),
(long long) getpid());
CFSTR("FluidSynth virtual port%s"),
clientid);
else
str_portname = CFStringCreateWithCString (NULL, portname,
kCFStringEncodingASCII);