Re: [AD] CMake on Mac OS X

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


I've had a go at finding that Vorbis library. I made a change to
addons/acodec/CMakeLists.txt and added a file cmake/FindVorbis.cmake.
Works for me, can someone test it?

Pete

Index: addons/acodec/CMakeLists.txt
===================================================================
--- addons/acodec/CMakeLists.txt        (revision 10793)
+++ addons/acodec/CMakeLists.txt        (working copy)
@@ -1,5 +1,7 @@
 include_directories(../kcm_audio)

+FIND_PACKAGE(Vorbis QUIET)
+
 option(WANT_FLAC "Enable FLAC support (acodec)" on)
 option(WANT_VORBIS "Enable Ogg Vorbis support (acodec)" on)
 option(WANT_SNDFILE "Enable WAV/AIFF/FLAC support (acodec)" on)
@@ -33,26 +35,13 @@
 endif(WANT_FLAC)

 if(WANT_VORBIS)
-    check_c_source_compiles("
-        #include <vorbis/vorbisfile.h>
-        int main(void) {
-            (void)OV_CALLBACKS_NOCLOSE;
-            return 0;
-        }"
-        CAN_VORBIS
-        )
-
-    if(VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY)
-        set(CAN_VORBIS 1)
-    endif(VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY)
-
-    if(CAN_VORBIS)
+    if(VORBIS_FOUND)
         set(SUPPORT_VORBIS 1)
         set(ALLEGRO_CFG_ACODEC_VORBIS 1)
         include_directories(${VORBIS_INCLUDE_DIR})
-        list(APPEND ACODEC_EXTRA_LIBS vorbisfile vorbis ogg)
+        list(APPEND ACODEC_EXTRA_LIBS ${VORBIS_LIBRARY}
${VORBISFILE_LIBRARY} ${OGG_LIBRARY})
         list(APPEND ACODEC_SOURCES ogg.c)
-    endif(CAN_VORBIS)
+    endif(VORBIS_FOUND)
 endif(WANT_VORBIS)

 if(WANT_SNDFILE)


On Wed, Sep 10, 2008 at 7:06 PM, Milan Mimica <milan.mimica@xxxxxxxxxx> wrote:
> Trent Gamblin wrote:
>>
>> Ya, I realized now that it will find libraries and includes with
>> find_path/find_library if you put your compiler include/lib dirs in
>> your PATH. It's weird that it would use PATH for that, but it works.
>
>  > find_library(VORBIS_LIBRARY NAMES vorbisfile PATHS ENV LIB)
>
> That's weird because LIB is also listed there to be searched. We should report a
> bug.
>
>
>
> --
> Milan Mimica
> http://sparklet.sf.net
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> --
> https://lists.sourceforge.net/lists/listinfo/alleg-developers
>

Attachment: FindVorbis.cmake
Description: Binary data



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/