crt32
01-09-2010 09:33:05
This one gave me a lot of trouble, so I decided to share how I made it work, since I couldn't find any help in the forums or at google.
Here is how I changed CMakeLists.txt: (basically replaced the PKG_CHECK_MODULES part)
In my build system Ogre is already found (the script for that is kind of longish so I decided not to include it), check the wiki if you have trouble with that.
If you use the 32-bit build of ogre, add somewhere
Next, I had to change OgreOggSoundPrereqs.h:
(OpenAL.framework does not have an AL subdirectory)
To make it work, I had to build Ogg.framework and Vorbis.framework myself. OpenAL is already included in Xcode.
To accomplish this, get Ogg and Vorbis from here (latest version):
http://downloads.xiph.org/releases/ogg/
http://downloads.xiph.org/releases/vorbis/
Extract and for both of them (you will need to build ogg first) do the following:
- Open the Xcode project in subdirectory macosx
- For both Project and Active Target set SDK to current and Architecture to 32-bit (except you run a 64 bit build of ogre)
- Build and copy the .framework to /Library/Frameworks
I hope this helps someone, since I spent a lot of time on figuring this out.
Here is how I changed CMakeLists.txt: (basically replaced the PKG_CHECK_MODULES part)
In my build system Ogre is already found (the script for that is kind of longish so I decided not to include it), check the wiki if you have trouble with that.
if (APPLE)
FIND_PACKAGE(OPENAL REQUIRED)
FIND_LIBRARY(OGG Ogg REQUIRED)
FIND_LIBRARY(VORBIS Vorbis REQUIRED)
set(OGG_LIBRARIES ${OGG})
set(VORBISFILE_LIBRARIES ${VORBIS})
set(VORBISFILE_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS})
set(OPENAL_INCLUDE_DIRS ${OPENAL_INCLUDE_DIRS} ${OPENAL_INCLUDE_DIR})
set(OPENAL_LIBRARIES ${OPENAL_LIBRARIES} ${OPENAL_LIBRARY})
else ()
FIND_PACKAGE(PkgConfig REQUIRED)
PKG_CHECK_MODULES(OPENAL REQUIRED openal)
PKG_CHECK_MODULES(OGG REQUIRED ogg)
PKG_CHECK_MODULES(VORBISFILE REQUIRED vorbisfile)
endif()
If you use the 32-bit build of ogre, add somewhere
if (APPLE)
set(CMAKE_OSX_ARCHITECTURES "i386")
endif()
Next, I had to change OgreOggSoundPrereqs.h:
(OpenAL.framework does not have an AL subdirectory)
#elif OGRE_COMPILER == OGRE_COMPILER_GNUC
# if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
# include <al.h>
# include <alc.h>
# else
# include <AL/al.h>
# include <AL/alc.h>
# endif
To make it work, I had to build Ogg.framework and Vorbis.framework myself. OpenAL is already included in Xcode.
To accomplish this, get Ogg and Vorbis from here (latest version):
http://downloads.xiph.org/releases/ogg/
http://downloads.xiph.org/releases/vorbis/
Extract and for both of them (you will need to build ogg first) do the following:
- Open the Xcode project in subdirectory macosx
- For both Project and Active Target set SDK to current and Architecture to 32-bit (except you run a 64 bit build of ogre)
- Build and copy the .framework to /Library/Frameworks
I hope this helps someone, since I spent a lot of time on figuring this out.