Step 01.04: Use CMake to create the Xcode project.
Run CMake using the command line configuration utility. You may need to set the OGRE_HOME environment variable first if you get the Could not locate OGRE error
Copy to clipboard
$ export OGRE_HOME=/Users/elvis/Tool/ogre-1.7.1
$ cd OGRETutorialFramework
$ mkdir build
$ cd build
$ ccmake -GXcode ..
Launch XCode using the newly generated OGRETutorialFramework.xcodeproj file.
Edit the project settings, by clicking on menu option Project > Project Settings and modifying the following entries:
Copy to clipboard
Architectures = i386 x86_64
Base SDK = Current Mac OS
C/C++ Compiler Version = LLVM-GCC 4.2
Instruction Scheduling = None
Click on menu option Build > Build to build the project.
This will build the OGRETutorialFramework application executable in the OGRETutorialFramework/build/RelWithDebInfo folder.
Step 01.06: Copy the OGRE resource and plugin configuration files to the application folder.
Copy the resouces.cfg and plugins.cfg files to the your OGRE application folder, which in this case, would be OGRETutorialFramework/build/RelWithDebInfo
resources.cfg
Copy to clipboard
# Resources required by the sample browser and most samples.
[Essential]
Zip=/Users/elvis/Tool/ogre-1.7.1/Samples/Media/packs/SdkTrays.zip
FileSystem=/Users/elvis/Tool/ogre-1.7.1/Samples/Media/thumbnails
# Common sample resources needed by many of the samples.
# Rarely used resources should be separately loaded by the
# samples which require them.
[Popular]
FileSystem=/Users/elvis/Tool/ogre-1.7.1/Samples/Media/fonts
FileSystem=/Users/elvis/Tool/ogre-1.7.1/Samples/Media/materials/programs
FileSystem=/Users/elvis/Tool/ogre-1.7.1/Samples/Media/materials/scripts
FileSystem=/Users/elvis/Tool/ogre-1.7.1/Samples/Media/materials/textures
FileSystem=/Users/elvis/Tool/ogre-1.7.1/Samples/Media/materials/textures/nvidia
FileSystem=/Users/elvis/Tool/ogre-1.7.1/Samples/Media/models
FileSystem=/Users/elvis/Tool/ogre-1.7.1/Samples/Media/particle
FileSystem=/Users/elvis/Tool/ogre-1.7.1/Samples/Media/DeferredShadingMedia
FileSystem=/Users/elvis/Tool/ogre-1.7.1/Samples/Media/PCZAppMedia
FileSystem=/Users/elvis/Tool/ogre-1.7.1/Samples/Media/RTShaderLib
FileSystem=/Users/elvis/Tool/ogre-1.7.1/Samples/Media/RTShaderLib/materials
Zip=/Users/elvis/Tool/ogre-1.7.1/Samples/Media/packs/cubemap.zip
Zip=/Users/elvis/Tool/ogre-1.7.1/Samples/Media/packs/cubemapsJS.zip
Zip=/Users/elvis/Tool/ogre-1.7.1/Samples/Media/packs/dragon.zip
Zip=/Users/elvis/Tool/ogre-1.7.1/Samples/Media/packs/fresneldemo.zip
Zip=/Users/elvis/Tool/ogre-1.7.1/Samples/Media/packs/ogretestmap.zip
Zip=/Users/elvis/Tool/ogre-1.7.1/Samples/Media/packs/ogredance.zip
Zip=/Users/elvis/Tool/ogre-1.7.1/Samples/Media/packs/Sinbad.zip
Zip=/Users/elvis/Tool/ogre-1.7.1/Samples/Media/packs/skybox.zip
[General]
FileSystem=/Users/elvis/Tool/ogre-1.7.1/Samples/Media
Ensure that you update the location of the plugins in the plugin.cfg file.
Step 01.07: Run the OGRE application.
Type the following commands into a terminal to run the application
Copy to clipboard
cd OGRETutorialFramework/build/RelWithDebInfo
$ ./OGRETutorialFramework
Step 02.00: Resolve issues that you may encounter when attempting to run the OGRE application.
Issue 01: Duplicate libjpeg.dylib in you $DYLD_LIBRARY_PATH.
If you get issues relating to duplicate libjpeg.dylib installed in /usr/local/lib, then make sure that you remove any references to that path in the $DYLD_LIBRARY_PATH environment variable, defined in your .profile.
This is probably because OGRE links to libJPEG.dylib, plus case-preserving but case-insensitive makes it see them as the same library (when DYLD env vars are messed with).
Copy to clipboard
$ otool -L /System/Library/Frameworks/ApplicationServices.framework/Frameworks/ImageIO.framework/ImageIO
...
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib (compatibility version 1.0.0, current version 1.0.0)
...
Instead define the $DYLD_FALLBAK_LIBRARY_PATH environment variable
Issue 02: OGRE EXCEPTION(6:FileNotFoundException): 'resources.cfg' file not found!
Ensure that the resouces.cfg file generated from the ORGRE build process, located in build/bin is put in the same location as your application executable.
Issue 03: OpenGL rendering subsystem and OGRE plugins not getting loaded.
Ensure that the plugins.cfg file is located in the same folder as your application executable. Also ensure that you specify the location of the OGRE plugins, in the pluging.cfg file as follows:
Issue 04: Window doesn't seem to get focus.
If the application window is unable to get focus, the parameters in the configuration dialog cannot be changed, and the application will not receive mouse and keyboard input events. Add the following line to the CMakeList.txt file to create a bundle for the application: