so here's what I am trying to achieve :
First things first, I'm on Ubuntu 17.10. My goal is to compile Ogre3D then build the sample program as explained on the basic cmake project setup page: Ogre3D 1.10 cmake setup
I have successfully compiled Ogre and installed it as usual (in /usr/local
) for more ease when compiling my own project. So basically, I ended up with:
- The current Ogre3D source code (cloned from github)
- Build results from this source code (as explained in the relevant help file in the sources). Keep in mind that at this point, all essential dependencies are met and the build finishes without any problem.
My project files, set up and generated using this
CMakeLists.txt
:cmake_minimum_required(VERSION 3.9) find_package(OGRE 1.10 REQUIRED) include_directories(${OGRE_INCLUDE_DIRS}) link_directories(${OGRE_LIBRARY_DIRS}) file(COPY ${OGRE_CONFIG_DIR}/plugins.cfg ${OGRE_CONFIG_DIR}/resources.cfg DESTINATION ${CMAKE_BINARY_DIR}) project(Ogretest) add_executable(Ogretest main.cpp)
Obviously, with Ogre installed in /usr/local, this works as is, but otherwise I have to specify the correct path. None of that is an issue.
- A main.cpp file which is just a copy of the Bootstrap.cpp file mentioned in the tutorial. I added it to the project then tried to build.
At this point, some things have grabbed my attention.
The sample browser, built at the same time as the rest of Ogre, which depends on the same OgreBites component that is used in the tutorial, does not work at all for the fancy reason that libfreetype.so.2.6 isn't found. Sure enough, freetype is actually built during the configuration of cmake for Ogre's build and I really do not see why it would have any problems with it.
The sample program doesn't compile on account of SDLK_ESCAPE not being declared, or rather not in the right scope. This is very annoying as I have virtually no idea whether or not this is due to a problem with Ogre, SDL or whatever else. My hunch is that there is a serious problem with OgreBites on my system.
So.
Seeing as this "tutorial" for building and using the latest version of Ogre with cmake is... vague at best and really seems to summarize to "copy sample file and build your stuff somehow", I really only have two options here.
Either someone tries to direct me in finding out whatever insane problem is plaguing me or, and I think this would be more interesting, someone builds Ogre and this sample program themselves then shows what they did exactly (even though I'm ready to bet that nobody is going to have issues, but hey)
(Also, keeping the best for the end, I thought installing the build results with sudo make install was a good idea, but the makefile has no uninstall option and I'm boned when it comes to cleaning the install. Unless someone has an idea ?)