Ogre Cmake project generation

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Post Reply
Lax
Hobgoblin
Posts: 583
Joined: Mon Aug 06, 2007 12:53 pm
Location: Saarland, Germany
x 50

Ogre Cmake project generation

Post by Lax »

Hi,

I would like to start porting my engine to linux ubuntu and have a few questions:

  • Which ide do you use on linux?

  • Is it possible when building cmake ogre to genereta the project e.g. for eclipse? Or the ide, you use?

On windows i get visual studio project files in order to build Ogre. But how would this work on linux ubuntu?

Best Regards
Lax

http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62

User avatar
Crystal Hammer
Gnome
Posts: 318
Joined: Sat Jun 23, 2007 5:16 pm
x 77
Contact:

Re: Ogre Cmake project generation

Post by Crystal Hammer »

I'm on Debian, and using VSCodium, it needs some work to set up, at least C++ and CMake extensions. I got many more.
Used Qt Creator before too, it's less fancy, needs less effort to start. It already has CMake support.
In both, you just open folder with CMakeList.txt of your project. That's it, both should understand it and be able to build & run.
As for Ogre, only tried it once, it's big. I don't change it so can't say much if these IDEs can handle it.

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5298
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1279
Contact:

Re: Ogre Cmake project generation

Post by dark_sylinc »

Qt Creator has IMO the best integration with CMake and will fell the most familiar for Visual Studio users.

VS Code is also very good. Other uses prefer Eclipse but personally I stay away as far as possible from it. It's very bloated for my taste.

This video from Bruce Dawson (back when he worked for Valve) is an excellent introduction:

Just to give a small explanation:

  • On Linux there are two main ways to drive C++ builds (there's more though). They're actually powerful systems to do generic automation, not just building C++ projects:

    1. GNU Make

    2. Ninja (it's newer and for most purposes, superior)

  • IDEs have various ways of working on Linux:

    1. The IDE parses CMakeCache.txt generated by CMake in the build folder (this is what Qt Creator used to do a long time ago)

    2. Using CMake in server mode, and directly talk to it (this is what Qt Creator does now)

    3. Having its own build system (e.g. Qt Creator has QMake, Visual Studio on Windows uses msbuild and sln files, KDevelop also has its own project system which CMake supports generation natively)

    4. Having a generic interface e.g. Qt Creator supports adding source folders, include folders, and then asking you what command to run in order to build (like "make all" or "ninja" or "gcc myFile.cpp")

Today Qt Creator with native CMake integration in Server mode works great and that's what I use.
VSCode also works.

This one is for Qt Creator for Windows, but the workflow is the same for Linux:

VS Code

Protip: if the videos are too slow for you, just set the playback speed to 1.5x or 2.0x

Post Reply