Page 1 of 1

[2.1] Sample Build Error

Posted: Wed Aug 14, 2019 7:34 pm
by DrSeuss
Ogre Version: 2-1-0 unstable
Operating System: Ubuntu 18.04


I'm completely new to OGRE. I've cloned the bitbucket repo and build it on my linux machine, and the next step was to guild some of the samples to learn the API. This is also the first time I'm using Cmake, so please bear with me as I'm not quite sure where my issue is coming from.

My process: followed ... linux.html on installing OGRE (clone OGRE & dependencies, build dependencies, build debug, build release)

open terminal in Ogre/samples/tutorial01

Code: Select all

mkdir build
cd build
cmake ../
at this point cmake throws the following exception:

Code: Select all

CMake Error at CMakeLists.txt:25 (ogre_add_executable):
  Unknown CMake command "ogre_add_executable".
and does not make a MakeFile, so the sample code can't be build. the ogre_add_executable command is the one that should be adding the source code to the makefile if I understand correctly, so it's not like I can just go comment it out of the cmakelists.txt file. Is there something that I haven't built properly that would be causing cmake to not recognize this command? The output log is intimidating and unreadable since I don't know what to look for. Any help would be very appreciated.

Re: [2.1] Sample Build Error

Posted: Wed Aug 14, 2019 8:43 pm
by dark_sylinc

See this answer.

There's something I couldn't understand well: were you able to build the samples (any of them)?
Have you tried our build scripts?


Re: [2.1] Sample Build Error

Posted: Wed Aug 14, 2019 11:40 pm
by DrSeuss
Hey Matias,

Thanks for the direction to that other thread- I had been trying to build the tutorials as standalone projects when sure enough they had been built as part of ogre. I will try taking the tutorials that I've fiddled around with and compiling them in the "empty project"- which as I understand is the only one of the tutorials configured to be built as a standalone- and I believe that should give me the result I was originally hoping for, which was to make small changes to the tutorials as I begin learning ogre.

As for the build scripts, I found them after I had already cloned/built at the command line, and so I did not use them. What is the difference between the method on this page and using the build scripts?

Re: [2.1] Sample Build Error

Posted: Thu Aug 15, 2019 12:40 am
by dark_sylinc

The online docs pages haven't been updated to mention the scripts.

The scripts just make your life easier and reduce margin of errors. But if you basically follow the steps of the guide you should be more or less doing what the scripts perform.

Often we get questions that something is broken, and that's because the steps weren't followed to the letter or a step was misunderstood. Our build process is unfortunately a little complicated so I can't really blame users. Thus the scripts supposedly just make the process user friendly.

And yes, for the regular tutorials; they have to be build together with Ogre; and you can setup your own project by using EmptyProject as a bootstrap.

Similar projects that were based on EmptyProject are Dergo (watchout v2-2 vs v2-1 branches), livingroom (uses v2-1) and Colibri (uses v2-2)