On May 29, 2013 12:51:02 AM Florian Jung wrote:
> and to the list
>
>
> -------- Original-Nachricht --------
> Betreff: Re: [Lmuse-developer] add RubberBand to the libraries
> Datum: Tue, 28 May 2013 23:11:01 +0200
> Von: Florian Jung <[email protected]>
> An: Tim E. Real <[email protected]>
>
> Hi Tim,
>
> thanks for this detailed answer! I think i'll make it optional in the
> end, because AudioStream also has a non-stretching mode of operation
> (this mode uses libsamplerate then).
>
> But how can I find out whether rubberband support is enabled or not?
> Surely there's some #define HAVE_RUBBERBAND or similar?
>
> Greetings,
> flo
D'oh, sorry! I left out one important detail - how to communicate
defines from the cmake lists to the app proper.
Open the file /config.h.in and add this amongst the others:
#cmakedefine RUBBERBAND_SUPPORT
Now throughout the app you can check #ifdef RUBBERBAND_SUPPORT.
Obviously you don't need this if the feature is *not* optional.
You can also communicate variables this way, as shown by the
#defines further down the list in /config.h.in.
Tim.
>
> Am 28.05.2013 00:47, schrieb Tim E. Real:
> > On May 27, 2013 11:18:29 PM Florian Jung wrote:
> >> Hi,
> >>
> >> the AudioStreams (which also support stretching via the RubberBand
> >> library) finally compile. However, they won't link because we need to
> >> link in the rubberband library. How do i do this with CMake? Can please
> >> someone send, and possibly explain me the patch for the CMakeList.txt (i
> >> hope it goes there?)
> >>
> >> greetings and thanks
> >> flo
> >
> > ------------------
> > Method 1):
> > ------------------
> > If the feature is optional, you'll want to add the option choice near the
> > top>
> > of the top-level CMakeLists.txt:
> > option ( ENABLE_RUBBERBAND "Enable RubberBand stretching support" ON)
> >
> > Then further down in the 'Optional packages' section:
> >
> > if (ENABLE_RUBBERBAND)
> >
> > PKG_CHECK_MODULES(RUBBERBAND rubberband>=1.0)
> > if (RUBBERBAND_FOUND)
> >
> > include_directories(${RUBBERBAND_INCLUDE_DIRS})
> > set(RUBBERBAND_SUPPORT ON)
> >
> > endif (RUBBERBAND_FOUND)
> >
> > else (ENABLE_RUBBERBAND)
> >
> > message("RUBBERBAND disabled")
> >
> > endif (ENABLE_RUBBERBAND)
> >
> > Then further down in 'Report errors and warnings and hints' section add:
> >
> > if (ENABLE_RUBBERBAND AND (NOT RUBBERBAND_FOUND))
> >
> > message("** WARNING: rubberband (>= 1.0) was enabled, but
> > development
> >
> > files were not found.")
> > endif (ENABLE_RUBBERBAND AND (NOT RUBBERBAND_FOUND))
> >
> > And finally further down, in the summary printout:
> >
> > summary_add("rubberband support" RUBBERBAND_SUPPORT)
> >
> > Now, depending on where exactly this support is used, link the library.
> > For example for OSC, sndfile, and samplerate libraries, we link them
> >
> > in the "muse/CMakeLists.txt" file because they're used globally.
> >
> > So you would do this, just after the 'Linkage' section:
> >
> > if(RUBBERBAND_SUPPORT)
> >
> > target_link_libraries(core ${RUBBERBAND_LIBRARIES})
> >
> > endif(RUBBERBAND_SUPPORT)
> >
> >
> > ------------------
> > Method 2):
> > ------------------
> > If the feature is *not* optional and must be there always, you'll want to
> >
> > add this in the 'Mandatory packages' section of the top-level
CMakeLists.txt:
> > PKG_CHECK_MODULES(RUBBERBAND REQUIRED rubberband>=0.1.0)
> > include_directories(${RUBBERBAND_INCLUDE_DIRS})
> >
> > Then further down in 'Report errors and warnings and hints' section add:
> >
> > if (NOT RUBBERBAND_FOUND)
> >
> > message("** ERROR: rubberband >= 0.1.0 is required, but development
> > files
> >
> > were not found.")
> > endif (NOT RUBBERBAND_FOUND)
> >
> > Now, depending on where exactly this support is used, link the library.
> > For example for OSC, sndfile, and samplerate libraries, we link them
> >
> > in the "muse/CMakeLists.txt" file because they're used globally.
> >
> > So you would do this, inside the 'Linkage' section:
> >
> > target_link_libraries(core
> > ...
> >
> > ${RUBBERBAND_LIBRARIES}
> >
> > ...
> > )
> >
> > ------------------
> > That should pretty much do it. I hope...
> >
> > Tim.
> >
------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
_______________________________________________
Lmuse-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lmuse-developer