History: Building Dependencies
Source of version: 6
Copy to clipboard
Most of the time you will grab precompiled dependencies for OGRE, at least on Windows. However, if you want to build them yourself, here's a guide. The dependencies are (for Eihort):
__Core Dependencies__
* [http://www.freetype.org|FreeType]
* [http://freeimage.sourceforge.net|FreeImage]
* [http://www.zlib.net|Zlib]
* [http://zziplib.sourceforge.net|ZZiplib]
__Optional Plugin Dependencies__
* [http://developer.nvidia.com|Cg] (required for Plugin_CgProgramManager)
__Sample Program Dependencies__
* [http://sourceforge.net/projects/wgois/|OIS] (''Sourceforge Project Page'')
* [http://www.cegui.org.uk|CEGUI]
* [http://www.ode.org|ODE]
!MS Visual C++
You'll notice some tweaks have to be made to a few of the dependencies to make them build using the /MD or /MDd options (Multithreaded [Debug] DLL runtime library). This is required to ensure the memory heap and library functions used are consistent across the board.
!!Freetype
* Grab the latest source from the [http://www.freetype.org|FreeType website] and extract it somewhere
* Open freetype.sln from freetype-x.x.x/builds/win32/visualc
* FreeType is already configured to use /MD or /MDd code generation, so no change
* Freetype has no dependencies of its own so just hit 'Tools|Batch Build' and pick ''only'' the Debug and Release targets. Ignore the Debug Multithreaded and other targets. The default Debug and Release targets produce a static lib which is in fact multithreaded, and crucially uses the Multithreaded [Debug] DLL runtime, ie /MD or /MDd. The others use non-compatible runtimes.
* Once that's done, copy:
** the contents of freetype-x.x.x/include into ogrenew/Dependencies/include
** freetype-x.x.x/objs/freetypexxx.lib to ogrenew/Dependencies/lib/Release
** freetype-x.x.x/objs/freetypexxx_D.lib to ogrenew/Dependencies/lib/Debug
!!Zlib
* Grab the latest from the [http://www.zlib.net|Zlib site]
* Open zlib-x.x.x/projects/visualc6/zlib.dsw and upgrade it
* Edit the LIB_Debug and LIB_Release project settings and in the Resources|General section, remove the resource name
* Hit 'Build|Batch Build' and select the zlib LIB_Debug and LIB_Release projects
* Copy:
** zlib.h and zconf.h from zlib-x.x.x/include to ogrenew/Dependencies/include
** zlib.lib from zlib-x.x.x/projects/visualc6/Win32_LIB_Release to ogrenew/Dependencies/lib/Release
** zlibd.lib from zlib-x.x.x/projects/visualc6/Win32_LIB_Release to ogrenew/Dependencies/lib/Debug
!!FreeImage
* FreeImage relies on Zlib, but notice that a copy of Zlib is already shipped with it. Do not confuse this with the copy of Zlib you just installed.
* Grab the latest from the [http://freeimage.sourceforge.net|FreeImage website]
* Open FreeImage.sln
* Change the C++ Code Generation option in ''all projects'' to 'Multithreaded [Debug] DLL', instead of the default 'Multithreaded [Debug]'.
* Hit Build|BatchBuild and pick the FreeImageLib Debug and FreeImageLib Release targets - dependencies will be built automatically.
* Copy from the 'Dist' folder:
** FreeImage.h to ogrenew/Dependencies/include
** FreeImage.lib to ogrenew/Dependencies/lib/Release
** FreeImaged.lib to ogrenew/Dependencies/lib/Debug
!!Cg
* Grab the latest supported version from the [http://developer.nvidia.com|NVidia developer site]. Cg 1.4.x and Cg 2.0.x are currently supported. Cg 1.5 has a SM1 bug in it and should not be used.
* Copy:
** the contents of the Cg distribution 'include' folder into ogrenew/Dependencies/include/Cg
** lib/cg.lib into ogrenew/Dependencies/lib/Debug and ogrenew/Dependencies/lib/Release
** bin/cg.dll into ogrenew/Samples/Common/bin/Debug and ogrenew/Samples/Common/bin/Release
!!Zziplib
* Grab the latest from the [http://zziplib.sourceforge.net|Zziplib site]
* Open zziplib-x.x.x/msvc7(or8)/zzliplib.sln
* Change the C++ Code Generation option in Debug and Release targets to 'Multithreaded [Debug] DLL', instead of the default 'Multithreaded [Debug]'.
* Change the linker input from zdll.lib to zlib.lib in release and zlibd.lib in debug.
* Make sure zlib is on your path
* Hit 'Build|Batch Build' and select both projects
* Copy:
** _msvc.h, conf.h, types.h and zzip.h from zziplib-x.x.x/zzip to ogrenew/Dependencies/include/zzip
** zziplib.lib from zziplib-x.x.x/lib to ogrenew/Dependencies/lib/Release
** zziplibd.lib from zziplib-x.x.x/lib to ogrenew/Dependencies/lib/Debug
!!OIS
* Grab the latest stable version from [http://www.wreckedgames.com/wiki/index.php/WreckedLibs:OIS|OIS site]
* Open ois/win32/ois_vc8.sln (or ois.sln)
* Hit 'Build|Batch Build', select OIS_DebugDLL and OIS_ReleaseDLL
* Copy:
** All headers from ois/includes to ogrenew/Dependencies/include/OIS
** OIS.lib from ois/dll to ogrenew/Dependencies/lib/Release
** OIS_d.lib from ois/dll to ogrenew/Dependencies/lib/Debug
** OIS.dll from ois/dll to ogrenew/Samples/Common/bin/Release
** OIS_d.dll from ois/dll to ogrenew/Samples/Common/bin/Debug
!!CEGUI
* Grab the latest stable from the [http://www.cegui.org.uk|CEGUI Site], including dependencies for your compiler
* In makefiles/premake, run the batch file for your compiler version, then open the .sln it creates
* CEGUI is already configured to use /MD or /MDd code generation
* Hit 'Build|Batch Build' and pick CEGUIBase, CEGUIExpatParser, and CEGUIFalagardWRBase in both Debug and Release forms (ignore the with symbols version)
* Copy:
** The contents of the include folder, with subfolders elements and falagard, to ogrenew/Dependencies/include/CEGUI
** CEGUIBase.lib from the lib folder to ogrenew/Dependencies/lib/Release
** CEGUIBase_d.lib from the lib folder to ogrenew/Dependencies/lib/Debug
** CEGUIBase.dll, CEGUIExpatParser.dll and CEGUIFalagardWRBase.dll from the bin folder to ogrenew/Samples/Common/bin/Release
** CEGUIBase_d.dll, CEGUIExpatParser_d.dll and CEGUIFalagardWRBase_d.dll from the bin folder to ogrenew/Samples/Common/bin/Debug
!!Boost
* Grab the latest release from [http://www.boost.org|Boost.org], and also the bjam binary archive
* Copy bjam.exe into the extracted boost folder
* To build the minimal set of components you need, run this at the command-line:
{CODE(wrap="1", colors="winbatch")}call <path_to_MSVC>\VC\bin\vcvars32.bat
rem for VC8
bjam --build-dir=vc8 --toolset=msvc-8.0 --with-thread --with-date_time --build-type=complete stage
rem for VC9
bjam --build-dir=vc9 --toolset=msvc-9.0 --with-thread --with-date_time --build-type=complete stage
rem for MinGW
bjam --build-dir=mingw --toolset=gcc --with-thread --with-date_time --build-type=complete stage
rem for gcc
bjam --build-dir=gcc --toolset=gcc --with-thread --with-date_time --build-type=complete stage{CODE}
Reference the include and stage/lib folder in your compiler settings.
!OS X
!!zziplib
* Use this script to build universal binaries: ((ZziplibBuildOSXUniversal))
!!FreeImage
* Just follow the in built instructions with 3.10 (README.osx).
* However, remember to rename libfreeimage to libFreeImage to match existing case.
* __Problem__: out of the box, FreeImage inverts the R and B channels of PNGs on an Intel machine, looks like a failure to correctly detect the endianness. Investigating - for now, using the old dependency build for FreeImage
!!FreeType
* The default build system doesn't build universal binaries so have to use a custom built .xcodeproj
* However I had to make the following change in ftbase.c:
{CODE(wrap="1", colors="c++")} #if defined( __APPLE__ ) && !defined ( DARWIN_NO_CARBON )
//#include <ftmac.c> <-- commented out
#endif{CODE}
The freetype.xcodeproj already includes ftmac.c so the #include isn't needed (indeed it doesn't work without altering the include paths). Copy the universals from build/Debug etc.
!!Cg
* Download Cg 2.0 from nvidia and install
* Move the created framework from /Library/Frameworks into Dependencies
!!OIS
* Grab the HEAD branch from CVS
* Open ois/Mac/XCode-2.2/OIS.xcodeproj and build Debug and Release
* Copy the libOIS.a from build/Release and build/Debug
---
Alias: (alias(BuildingDependencies))