I currently have Boost installed via Macports which is useful for other non-Ogre projects I'm working on.
When trying to build the iOS version of Ogre 1.8, I'm having to set -D OGRE_CONFIG_THREADS=0 to disable Boost as it seems to keep finding the (i386) ones in:
/opt/local/include
/opt/local/lib
instead of:
/../OGRE_SRC/iOSDependencies/include
/../OGRE_SRC/iOSDependencies/lib
I sense this is happening at the default Cmake Find Package level and I'm not sure of the correct edit to override this?
(update - will try setting -D Boost_INCLUDE_DIR etc ... )
iOS: Ensuring Boost is found in iOSDependencies
-
- Gremlin
- Posts: 178
- Joined: Fri Dec 24, 2010 7:55 pm
- x 10
-
- Gremlin
- Posts: 178
- Joined: Fri Dec 24, 2010 7:55 pm
- x 10
Re: iOS: Ensuring Boost is found in iOSDependencies
Nope... setting -D Boost_INCLUDE_DIR=/path_to/iOSDependencies/include -D Boost_LIBRARY_DIR=/path_to/iOSDependencies/lib seems to have made no difference.
Cmake is inexplicably still looking in /opt/local for these.
Cmake is inexplicably still looking in /opt/local for these.
-
- Gremlin
- Posts: 178
- Joined: Fri Dec 24, 2010 7:55 pm
- x 10
Re: iOS: Ensuring Boost is found in iOSDependencies
I ended up removing boost. i.e., sudo port uninstall boost
Sure enough, Cmake found the right libs this time in iOSDependencies.
As usual, it was only afterwards I found the following in FindBoost.cmake (in the Cmake installation) for anyone searching this topic in future:-
1. Boost_NO_SYSTEM_PATHS set to TRUE
2. Boost_DIR needs to be an environment variable in order to point to a Boost installation (include/lib), otherwise it has to point to a BoostConfig.cmake
Hindsight being a great thing, now I have to face the 5 million year wait for "sudo port install boost" again...
UPDATE
If anyone has this same problem, you can make a small edit to the script here:
http://ogre3d.org/tikiwiki/tiki-index.p ... 0iPhone%29
change:
to:
This will make sure that no pesky run-of-the-mill boost libraries get picked.

Sure enough, Cmake found the right libs this time in iOSDependencies.
As usual, it was only afterwards I found the following in FindBoost.cmake (in the Cmake installation) for anyone searching this topic in future:-
1. Boost_NO_SYSTEM_PATHS set to TRUE
2. Boost_DIR needs to be an environment variable in order to point to a Boost installation (include/lib), otherwise it has to point to a BoostConfig.cmake
Code: Select all
# Boost_DIR or The preferred installation prefix for searching for
# BOOST_ROOT or BOOSTROOT Boost. Set this if the module has problems finding
# the proper Boost installation.
#
# Note that Boost_DIR behaves exactly as <package>_DIR
# variables are documented to behave in find_package's
# Config mode. That is, if it is set as a -D argument
# to CMake, it must point to the location of the
# BoostConfig.cmake or Boost-config.cmake file. If it
# is set as an environment variable, it must point to
# the root of the boost installation. BOOST_ROOT and
# BOOSTROOT, on the other hand, will point to the root
# in either case.
#
# To prevent falling back on the system paths, set
# Boost_NO_SYSTEM_PATHS to true.
#
# To avoid finding boost-cmake installations, set
# Boost_NO_BOOST_CMAKE to true.
UPDATE
If anyone has this same problem, you can make a small edit to the script here:
http://ogre3d.org/tikiwiki/tiki-index.p ... 0iPhone%29
change:
Code: Select all
cmake -D OGRE_BUILD_PLATFORM_APPLE_IOS=1 -G Xcode $SRC
Code: Select all
cmake -D OGRE_BUILD_PLATFORM_APPLE_IOS=1 -D BOOST_ROOT:PATH=$SRC/iOSDependencies -D Boost_NO_SYSTEM_PATHS:BOOL=ON -G Xcode $SRC
This will make sure that no pesky run-of-the-mill boost libraries get picked.

