From 3eb39e0380c794f18089e224686fa13b891676e2 Mon Sep 17 00:00:00 2001 From: Pedro Lopez-Cabanillas Date: Wed, 11 Aug 2010 15:31:34 +0000 Subject: [PATCH] CMake and OSX build documentation updated. Thanks to Ebrahim Mayat --- fluidsynth/README-OSX | 40 +++++++++++++++++++++++++++++++--------- fluidsynth/README.cmake | 34 +++++++++++++++++++++++++++------- 2 files changed, 58 insertions(+), 16 deletions(-) diff --git a/fluidsynth/README-OSX b/fluidsynth/README-OSX index fc96f2a5..4ef26d2a 100644 --- a/fluidsynth/README-OSX +++ b/fluidsynth/README-OSX @@ -1,10 +1,10 @@ -fluidsynth-1.1.1 on Mac OS X +fluidsynth-1.1.2 on Mac OS X ----------------------------------------------------------------------- -fluidsynth-1.1.1 can be installed in two ways on your Apple computer: +fluidsynth-1.1.2 can be installed in three ways on your Apple computer: -A. Compilation and installation by hand ---------------------------------------- +A. Compilation and installation by hand using autotools +------------------------------------------------------- Requirements: - "XcodeTools.mpkg","DevSDK.pkg", "CoreAudioSDK.pkg" packages (The Leopard/Snow Leopard Install DVD) @@ -14,7 +14,7 @@ Requirements: - MIDI Patchbay 1.0.3 -- Optional: JackOSX.0.83*.pkg.zip +- Optional: JackOSX.0.85*.pkg.zip 1. Run configure && make: @@ -22,11 +22,33 @@ $ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure && make 2. make install as superuser -B. Compilation and installation of the fink fluidsynth package +B. Compilation and installation by hand using cmake +--------------------------------------------------- +Requirements: +- "XcodeTools.mpkg","DevSDK.pkg", "CoreAudioSDK.pkg" packages (The Leopard/Snow Leopard Install DVD) + +- Fink installation + +- libgnugetopt, readline5, libflac8-dev, libsndfile1-dev, glib2-dev, dbus1.3-dev and cmake from fink: e.g. "fink install libgnugetopt" + +- MIDI Patchbay 1.0.3 + +- Optional: JackOSX.0.85*.pkg.zip + +1. Run cmake from the newly-created "build" folder: + +$ mkdir build ; cd build ; cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local ; make + +where "/usr/local" could be replaced by the PREFIX of your choice. + +2. make install as superuser + + +C. Compilation and installation of the fink fluidsynth package -------------------------------------------------------------- -Note: The fink fluidsynth package is currently at version 1.0.9. The update will be announced after the source tarball for version 1.1.1 becomes officially available on http://fluidsynth.resonance.org. - +Note: The fink fluidsynth package is currently at version 1.1.1. The update will become available some time after the source tarball for version 1.1.2 becomes +officially available on http://fluidsynth.sourceforge.net Requirements: @@ -53,6 +75,6 @@ $ fluidsynth -a SOUND_DRIVER [-j] -m coremidi -p name_of_instance Connect MIDI I/O devices using MIDI Patchbay Ebrahim Mayat -29th November 2009 +12th August 2010 diff --git a/fluidsynth/README.cmake b/fluidsynth/README.cmake index 945ef296..481220a4 100644 --- a/fluidsynth/README.cmake +++ b/fluidsynth/README.cmake @@ -53,6 +53,9 @@ Valid values for boolean (enable-xxxx) options: 1, 0, yes, no, on, off. in Linux and other Unix systems) then execute make, gmake or mingw32-make. If you generated a project file, use your IDE to build it. +You may find more information in the project Wiki: + http://sourceforge.net/apps/trac/fluidsynth/wiki/BuildingWithCMake + Compiling with make =================== @@ -88,13 +91,17 @@ mailing list: http://lists.nongnu.org/mailman/listinfo/fluid-dev For developers - how to add a new feature to the CMake build system =================================================================== -Let's explain this issue with an example. We are adding D-Bus support to FluidSynth as an optional feature, conditionally adding source files that require this feature. The first step is to add a macro "option()" to the main CMakeLists.txt file, the one that is located at the fluidsynth root directory. +Let's explain this issue with an example. We are adding D-Bus support to +FluidSynth as an optional feature, conditionally adding source files that +require this feature. The first step is to add a macro "option()" to the main +CMakeLists.txt file, the one that is located at the fluidsynth root directory. file CMakeLists.txt, line 64: option ( enable-dbus "compile DBUS support (if it is available)" on ) -Now, let's check if the dbus-1 library and headers are installed, using pkg-config: +Now, let's check if the dbus-1 library and headers are installed, using +pkg-config: file CMakeLists.txt, lines 329-334: @@ -105,9 +112,16 @@ file CMakeLists.txt, lines 329-334: set ( DBUS_SUPPORT ${DBUS_FOUND} ) endif ( enable-dbus ) -The two first lines clear the values of the CMake variables DBUS_LIBRARIES and DBUS_SUPPORT. If the value of the option "enable-dbus" is true, then the macro pkg_check_modules() is used to test a package named "dbus-1" with version 1.0.0 or later. This macro automatically defines the variables DBUS_LIBRARIES, DBUS_INCLUDEDIR, DBUS_FOUND and others. The value of the last one is assigned to our variable DBUS_SUPPORT for later use. +The two first lines clear the values of the CMake variables DBUS_LIBRARIES and +DBUS_SUPPORT. If the value of the option "enable-dbus" is true, then the macro +pkg_check_modules() is used to test a package named "dbus-1" with version 1.0.0 +or later. This macro automatically defines the variables DBUS_LIBRARIES, +DBUS_INCLUDEDIR, DBUS_FOUND and others. The value of the last one is assigned +to our variable DBUS_SUPPORT for later use. -There is a report to summarize the performed checks and the enabled features after the configuration steps, so let's add a line in this report regarding the D-Bus support. +There is a report to summarize the performed checks and the enabled features +after the configuration steps, so let's add a line in this report regarding +the D-Bus support. file cmake_admin/report.cmake, lines 14-18: @@ -117,19 +131,25 @@ file cmake_admin/report.cmake, lines 14-18: message ( "D-Bus: no" ) endif ( DBUS_SUPPORT ) -The variable DBUS_SUPPORT is available for the CMake files, but we want to make it available to the compilers as well, to conditionally build code using "#ifdef DBUS_SUPPORT". This can be done adding a line to the config.cmake file: +The variable DBUS_SUPPORT is available for the CMake files, but we want to make +it available to the compilers as well, to conditionally build code using +"#ifdef DBUS_SUPPORT". This can be done adding a line to the config.cmake file: file src/config.cmake, lines 22-23: /* Define if D-Bus support is enabled */ #cmakedefine DBUS_SUPPORT @DBUS_SUPPORT@ -The file config.cmake will be processed at configure time, producing a header file "config.h" in the build directory with this content, if the dbus support has been enabled and found: +The file config.cmake will be processed at configure time, producing a header +file "config.h" in the build directory with this content, if the dbus support +has been enabled and found: /* Define if D-Bus support is enabled */ #define DBUS_SUPPORT 1 -Finally, we can add the new source files to the build system for the compiler target with the macro add_library(), and the libraries for the linker target with the macros link_directories() and target_link_libraries(). +Finally, we can add the new source files to the build system for the compiler +target with the macro add_library(), and the libraries for the linker target +with the macros link_directories() and target_link_libraries(). file src/CMakeLists.txt, lines 57-60