I'm trying to build my ogre application for ios with cmake. Does anybody have experience with that?
I'm done with building "ogre samples" for ios. And the "sample browser" runs in ios simulator and on an ipad.
Then I've made a simple application with ogre that runs already on desktop platforms. Now I want to write a CMake Makefile that can generate a XCode iOS Project out of my code. I've looked in the Sample Browser Code but I didn't get it.
In the moment cmake stucks at finding ogre. What should I write in the CMAKE_MODULE_PATH? The path to the sample browser ios build didn't work. Here the whole cmake error message:
CMake Error at CMakeLists.txt:37 (find_package):
By not providing "FindOGRE.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "OGRE", but CMake did not find one.
Could not find a package configuration file provided by "OGRE" with any of the following names:
OGREConfig.cmake
ogre-config.cmake
Add the installation prefix of "OGRE" to CMAKE_PREFIX_PATH or set "OGRE_DIR" to a directory containing one of the above files. If "OGRE" provides a separate development package or SDK, be sure it has been installed.
${OGRE_ROOT} has to be the correct path to the root directory of the ogre source code (when compiling ogre yourself). If you use the OgreSDK for iOS from the download page, you have to write:
-- Could not locate OGRE
CMake Error at /XXX/OgreSDK/CMake/FindPkgMacros.cmake:120 (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.
Call Stack (most recent call first):
/XXX/OgreSDK/CMake/FindOGRE.cmake:245 (findpkg_finish)
CMakeLists.txt:43 (find_package)
Can someone help me with my problem? I found out that in FindOGRE.cmake the "OGRE_INCLUDE_DIR" variable isn't set. I think this variable should be set after this
But it is not. So the "if (OGRE_INCLUDE_DIR)" in line 183 (maybe it's a different line in your FindOGRE.cmake version) is false and OGRE is not found. Does anybody know why this could happen?
I think the ogre cmake build system is broken for iOS.
I fixed the OGRE_INCLUDE_DIR error from my last post with defining "set(OGRE_INCLUDE_DIR ${OGRE_SOURCE}/OgreMain/include)" in my CMakeLists.txt. But that's not a clean solution and now I've got the next problem:
-- Looking for OGRE...
-- Found Ogre Ghadamon (1.9.0)
-- Build type (static, dynamic) does not match the requested one.
-- Could not locate OGRE
CMake Error at /.../ogresource/CMake/Utils/FindPkgMacros.cmake:120 (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.
Call Stack (most recent call first):
/.../ogresource/CMake/Packages/FindOGRE.cmake:245 (findpkg_finish)
CMakeLists.txt:55 (find_package)
I don't know what "-- Build type (static, dynamic) does not match the requested one." should mean. I've set OGRE_STATIC to TRUE in my CMakeLists.txt because iOS needs static libraries.
EDIT: Really sorry for posting so many posts. I could fix the "static error" with defining "set(OGRE_CONFIG_INCLUDE_DIR ${OGRE_BUILD}/include)" in my CMakeLists.txt file. But there's still the "Could not locate OGRE" message.
(Even if nobody answers here, maybe this will be helpful for someone in the future having the same problems...)