User forums > Help

CMakeLists.txt and Code::Blocks

(1/4) > >>

gtafan:
Some C++ project are using CMakeLists.txt, to be honest I am not a fan of it, but how to compile such project with Code::Blocks?
I tried cmake-gui and was able to get as far, as this:



But what next?

gd_on:
If you click on Finish, you obtain an other Window where you can click on Configure. To avoid some errors, it may be useful to adjust the version in the first line of the main CMakeLists.txt.
In the configure Window (in red to show you that some adjustments may be required), many fields are automatically filled but you can have to adjust manually a few ones as CMAKE_BUILD_TYPE, CMAKE_CODEBLOCKS_EXECUTABLE and eventually Compile and link options.
When you click on Generate button, a codeblocks .cbp file is generated. Here too, you can rework it manually.

gtafan:

--- Quote from: gd_on on April 27, 2025, 05:46:14 pm ---If you click on Finish, you obtain an other Window where you can click on Configure. To avoid some errors, it may be useful to adjust the version in the first line of the main CMakeLists.txt.
In the configure Window (in red to show you that some adjustments may be required), many fields are automatically filled but you can have to adjust manually a few ones as CMAKE_BUILD_TYPE, CMAKE_CODEBLOCKS_EXECUTABLE and eventually Compile and link options.
When you click on Generate button, a codeblocks .cbp file is generated. Here too, you can rework it manually.

--- End quote ---
Have already clicked on Configure to get there, so gues have to select one of the options there.
When I select "Specify native compilers" and click "Next" geting to:



But no idea what to selct here.

When I select "Specify toolchain file for cross-compiling" and click "Next" geting to:



And when I select "Specify options for cross-compiling" and click "Next" geting to:

gd_on:
I use the first option "Use default native compilers", so nothing to fill manually and almost everything is correctly set.
For cross compiling, I suppose you have to set manually a few things, but sorry, as I don't do that, I can't help you more.
Better have a look on a cmake forum if it exists.

gtafan:

--- Quote from: gd_on on April 28, 2025, 06:05:45 pm ---I use the first option "Use default native compilers", so nothing to fill manually and almost everything is correctly set.
For cross compiling, I suppose you have to set manually a few things, but sorry, as I don't do that, I can't help you more.
Better have a look on a cmake forum if it exists.

--- End quote ---
Don't have native compilers, since I am using codeblocks-25.03mingw-nosetup. Gues have to use that "Specify native compilers" option, but have no idea what to select there.

Navigation

[0] Message Index

[#] Next page

Go to full version