Installing/compiling OgreProcedural for iOS

martiman

17-04-2013 15:05:53

Hi there,

I've been trying to compile OgreProcedural (checkout of hg repo) for iOS for a couple of hours without any luck. Goal is to get OgreProcedural working on iOS in my existing Ogre project in Xcode.

Following this howto and similar instructions found while googling always result in the following error:

Could not locate OGRE
CMake Error at CMake/Utils/FindPkgMacros.cmake:117 (message):
Required library OGRE not found! Install the library (including dev
packages) and try again. If the library is already installed, set the
missing variables manually in cmake.


I've downloaded the latest iOS compiled OgreSDK and put it in /Users/martijn/zazzy/tools/OgreSDK. OGRE_HOME is set to that path (using the CMake GUI, which apparently exists, or as bash environment variable, or with set() within CMakeLists.txt).

Does anyone know what's wrong? Can anyone write a simple howto on compiling OgreProcedurial for iOS in Xcode?

mikachu

18-04-2013 09:10:30

Hi,

Is your Ogre SDK compiled as a static library?
I don't know too much about iOS version, but static is the default option for android..

So, Ogre needs the CMake variable OGRE_STATIC set to true..

Tell me if it works for you, if so, I'll update the doc :)

martiman

18-04-2013 13:25:37

Same error.. It is the default pre-compiled SDK for iOS, downloaded from this website.

mikachu

18-04-2013 14:31:34

Unfortunately, I don't have any OSX machine to reproduce and debug...
But OgreProcedural makes a standard use of FindOgre.cmake, there's nothing specific about it.

It just callsfind_package(OGRE REQUIRED) and expects it to work, based on environnement..

So maybe asking for help on the 'mobile devices' forum would bring you some help? :)

Sorry I can't be more helpful on this.. :?

martiman

22-04-2013 13:05:35

The problem seems to have been a particular combination of the new Xcode and an older cmake version.

It compiles now after updating Xcode (Apple update), command line tools (via Xcode), and cmake (Mac ports) with:

mkdir build && cd build
make -D OGRE_BUILD_PLATFORM_APPLE_IOS=1 -D OGRE_HOME=/Path/To/OgreSDK/ -D OGRE_STATIC=TRUE -G Xcode ..

martiman

22-04-2013 23:57:13

Apparently, that doesn't do the trick: configuration is successfully build, but Xcode starts compiling for OSX, not iOS. That is, 'OGRE_PLATFORM' is set to 'OGRE_PLATFORM_APPLE' instead of 'OGRE_PLATFORM_APPLE_IOS', resulting in errors on finding the right Ogre OSX header files. Setting 'Supported Platforms' to iOS manually apparently isn't enough.

Am I missing Cmake variables settings? Or is there an easy way within Xcode to set everything necessary to compile OgreProcedural for iOS?

mikachu

24-04-2013 13:02:01

Just doing some guesswork here : is your baseSDK correctly configured?
From what I read, there's a CMAKE_OSX_SYSROOT property to be set...

In OgrePlatform.h, there's this definition:
# if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 40000 || __IPHONE_OS_VERSION_MIN_REQUIRED >= 40000
# define OGRE_PLATFORM OGRE_PLATFORM_APPLE_IOS
# else
# define OGRE_PLATFORM OGRE_PLATFORM_APPLE
# endif

So, if OGRE_PLATFORM is wrong, it's probably because the wrong sdk is used..

martiman

25-04-2013 13:31:29

The Ogre SDK is the pre-compiled iOS version, nothing to configure for that.

Somehow, cmake should be able to configure everything (including Ogre headers) so that everything gets compiled for iOS, right? Question is what are the settings for that.