[Solved] Quick question on setup with cmake

Problems building or running the engine, queries about how to use features etc.
professor_oats
Gnoblar
Posts: 11
Joined: Sat Jul 22, 2023 1:27 pm
x 2

[Solved] Quick question on setup with cmake

Post by professor_oats »

Ogre Version: 14.2.5
Operating System: Win 10
Render System: Any

Hello!

I recently managed to build solutions for Visual Studio and I'd like the option of using CMake and generate files for other IDE:s.

Building and generating with CMake through CMakeLists.txt is straight forward.
What I wonder is if I'd like to build and generate executionables, where would I put the new CMakeLists.txt file or commands?

I follow this along:
https://ogrecave.github.io/ogre/api/latest/setup.html

I am currently on it since building is tinkertown due to Internet problems when fetching packages for build,
I simply wonder when starting a new project in say Clion or any other IDE:

Would you start it from the build folder and add a new CMakeLists.txt as in the setup or will you append the lines to the one found in source?

I may solve it in time but any directions are appreciated. ^^

SOLVED:
12 hours in and I feel both stupid and wiser. I have learnt a lot about CMake and build systems.
What started the issue was when I tried to load a .sln file in Clion and it complained about being a Visual Studio solution.
At first I started to tinker with other generators than Visual Studio, Ninja to mention, to find out that it uses MinGW environment
which in case affected, and may affect, the linking to libraries (DirectX) outside the set environment.

I scratched the MinGW and learnt how to use the Visual Studio generator for Clion IDE and after some thread diving for
more on CMakeLists.txt I got things up and running.

The solution for me is to build the project and install with Visual Studio generator and then do the correct setup in the
IDE of choice.

First I thought of making a guide on the setup since I found an unsolved thread 2017(?) about Clion specifically
but honestly the solution is to build for the environment and then just use the same generator + toolchains and
adjust the project's CMakeLists.txt properly - which has a lot of information and guides on topic already.

It was a nice journey through build systems and library paths. :lol:

Last edited by professor_oats on Tue May 21, 2024 3:08 am, edited 1 time in total.
professor_oats
Gnoblar
Posts: 11
Joined: Sat Jul 22, 2023 1:27 pm
x 2

Re: Quick question on setup with cmake

Post by professor_oats »

Have a clean installed debug version now. Will see if I shall make a new project with Clion in this case and add the SDK to it.
When done I will write a quick setup guide. I bet the linux ppl already know how to setup a project without Visual Studio. :)

professor_oats
Gnoblar
Posts: 11
Joined: Sat Jul 22, 2023 1:27 pm
x 2

Re: Quick question on setup with cmake

Post by professor_oats »

Solved the main issue in understanding how to properly create a new project and add the sdk through CMakeLists.txt.
It has started to roll and I am in the midst of linking and setting up the runtime environments.
Current error is for ResourceManager when it will generate a config window, that it somehow won't find the resource like "Font" for ConfigDialog::display

Will see if manually setting a ResourceManager in the app will give results. :)