Re: [AD] CMake on Mac OS X

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


On 2008-09-10, Milan Mimica <milan.mimica@xxxxxxxxxx> wrote:
> Peter Hull wrote:
> > Another problem, it seems it can't find vorbis on my system. I think
> > it needs VORBIS_INCLUDE_DIR defining somewhere (I've been reading
> > http://www.cmake.org/Wiki/CMake_HowToFindInstalledSoftware) but I
> > can't see where. Other libraries e.g.. freetype do have the equivalent
> > defined and they work fine.
> 
> TFF addon has include(FindFreetype) in addons/CMakeLists which fills 
> FREETYPE_FOUND, FREETYPE_LIBRARIES and FREETYPE_INCLUDE_DIRS. There is nothing 
> that sets VORBIS_INCLUDE_DIR and VORBIS_LIBRARY...

I assume vorbis isn't in the default path.

We used to do the following but Trent changed it for some reason.
I'd try that, or else follow the find_path/find_library examples in
(e.g.) FindFreetype.cmake.

diff --git a/addons/acodec/CMakeLists.txt b/addons/acodec/CMakeLists.txt
index 93d398b..d2574ef 100644
--- a/addons/acodec/CMakeLists.txt
+++ b/addons/acodec/CMakeLists.txt
@@ -30,11 +30,14 @@ if(WANT_FLAC)
 endif(WANT_FLAC)

 if(WANT_VORBIS)
-    # XXX ogg.c doesn't compiler with libvorbis 1.1.2
-    # missing OV_CALLBACKS_NOCLOSE
-    find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h PATHS ENV INCLUDE)
-    find_library(VORBIS_LIBRARY NAMES vorbisfile PATHS ENV LIB)
-    mark_as_advanced(VORBIS_INCLUDE_DIR VORBIS_LIBRARY)
+    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)






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