OGRE-Next
3.0.0
Object-Oriented Graphics Rendering Engine
|
If you do not already have cmake
, install it with brew
or whatever your favorite way is:
We provide easy-to-use scripts that will download and setup all dependencies for you in a self-contained folder Download build_ogre_scripts for the branch you need from:
https://www.ogre3d.org/download/sdk/sdk-ogre-next
Clone dependencies from ogre-next-deps and build the ALL
target and then the INSTALL
target:
This will generate Dependencies under ogre-next-deps/build/ogrenext
. You will have to copy (or symlink) that folder into the OgreRepo and rename it to dependencies so that they the folder ogre-next-deps/build/ogrenext
is now OgreSrcRepo/Dependencies
SDL2 is not built by ogre-next-deps in macOS, use brew instead:
Note: XCode generator is supported
Note 2: Unless STATIC libs setting is used, XCode project dependencies are not properly setup thus e.g. if you try to build a sample, it won't compile RenderSystem_Metal which is needed (and possibly other components). Make sure to first build "ALL" target to build everything before trying the samples
Make sure you have set the current working directory to ogre's source directory:
At the time of writing this guide, a build error will occurr for the SampleMorphAnimations target (unless one is building .frameworks which this guide won't). So remove the following line line or comment it out, in Samples/2.0/CMakeLists.txt:130
that says:
add_subdirectory(ApiUsage/MorphAnimations)
Then configure the options to compose your flavor of what you want to build by setting ogre and cmake variables. Examples of variables that this guide configures:
Varible | What this guide will use it for |
---|---|
OGRE_BUILD_RENDERSYSTEM_GL3PLUS | Opt-out from OpenGL (Metal is already set to be built by default) |
OGRE_BUILD_LIBS_AS_FRAMEWORKS | Build .dylib/.a files instead of .framework |
OGRE_PLUGIN_LIB_PREFIX | Make sure the RenderSystem.dylib is named libRenderSystem.dylib to conform to *NIX standard |
CMAKE_INSTALL_PREFIX | Directory in which CMake should copy the final SDK files. A lib/ /bin and so on will be automatically created inside here |
CMAKE_INSTALL_NAME_DIR | Directory of where the installed target file is located, i.e. should be $CMAKE_INSTALL_PREFIX/lib . This will be imprinted in the target file itself, and can be verfied after install by e.g. otool -L $CMAKE_INSTALL_PREFIX/lib/OgreMain.dylib |
CMAKE_CXX_STANDARD | Compile with c++11 support |
CMAKE_CXX_FLAGS | Set explicit include directory. (C)Make seems to ignore this system directory otherwise. |
You can list all your available build options and adjust for your needs:
Configure the above variables ($PWD
will be replaced with the current working directory)
Generate a Makefile
Now, build ogre:
The -j2
tells make how many jobs will run concurrently. E.g. if you have 4 cores, use 4 instead of 2.
If everything went well, you should have an sdk located in the $PWD/sdk
directory.
Open and edit $PWD/sdk/plugins_tools_d.cfg
and $PWD/sdk/plugins_tools.cfg
and the value of PluginFolder
to $PWD/sdk/liband prefix all the
Pluginvalues with
lib(because we set the
$OGRE_PLUGIN_LIB_PREFIX` when building)
From the same working directory run:
and then run the following in the directory where the html.cfg
file is located:
Doc files should now be located at sdk/Docs/api/index.html
or whatever the OUTPUT_DIRECTORY
is set to in /html.cfg
.