Integrate Ogre as sub_directory() or ExternalProject in CMake

Problems building or running the engine, queries about how to use features etc.
Post Reply
rbaleksandar
Gnoblar
Posts: 2
Joined: Thu Aug 05, 2021 7:45 pm

Integrate Ogre as sub_directory() or ExternalProject in CMake

Post by rbaleksandar »

Ogre Version: latest (master branch)
Operating System: Windows, Linux
Render System: OpenGL

How would one integrate Ogre (cloned github repo) using

Code: Select all

add_subdirectory()
or preferably

Code: Select all

ExternalProject_Add()
in an existing CMake project?

I am looking into creating a CMake file for all of my external dependencies incl. (currently just for evaluating how painless the configuration, build and integration processes are) Ogre (not Ogre Next). Adding it as a subdirectory project yields configuration error (no surprise) when Assimp is processed as a dependency that is to be built by Ogre itself.

Code: Select all

assimpTargets
cannot find the assimp LIB file (that is the compile binary).

Since - unlike zlib - I don't use Assimp anywhere else I would prefer for it to be build as a second level dependency - a dependency of a dependency - in my project. However due to the missing configuration step, when configuring Ogre as a standalone project, this introduces a lot of issue. I am sure that Assimp is not the first one and in fact I am expecting zlib to give a shoutout too at some point. LOL This has been my experience so far for several years of using projects that rely on these libraries.

Has any one successfully added Ogre as a subdirectory project? Even better would be as an external project using the CMake module for this purpose. I would like to avoid spending several days (e.g. wxWidgets) hunting down configuration flags and hacking my way through the configuration of this project.
Post Reply