Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: inversesquare.zip on September 25, 2023, 01:05:59 am

Title: CMake Code::Blocks Generator Deprecation
Post by: inversesquare.zip on September 25, 2023, 01:05:59 am
Hello,
I've noticed several other people have requested how to use CMake with Code::Blocks and have been told to run a command like the following:
[snipped]
cmake . -G "CodeBlocks - Unix Makefiles"
[snipped]

However, that command is part of Extra Generators [1] which is, as mentioned in the description, deprecated. According to the CMake documentation, "support for Extra Generators is deprecated and will be removed from a future version of CMake." Is anyone planning on making Code::Blocks work with CMake some other way? Thank you for your time.

[1]https://cmake.org/cmake/help/latest/generator/CodeBlocks.html
Title: Re: CMake Code::Blocks Generator Deprecation
Post by: HunterZ on October 27, 2023, 08:39:33 pm
Wondering about this as well. This is making me hesitate to get too deep into Code::Blocks because CMake integration is a must.

Kitware seems to be encouraging IDE developers to integrate with their cmake-file-api: https://cmake.org/cmake/help/latest/manual/cmake-file-api.7.html
Title: Re: CMake Code::Blocks Generator Deprecation
Post by: stahta01 on October 27, 2023, 09:58:12 pm
Since they never really supported native CB Projects. Them dropping support for CB Custom makefile projects are not a major loss.
Title: Re: CMake Code::Blocks Generator Deprecation
Post by: ollydbg on October 28, 2023, 12:27:17 pm
Since they never really supported native CB Projects. Them dropping support for CB Custom makefile projects are not a major loss.

From my point of view, I agree with you.

The generated cbp(from CMakefiles) is just a makefile, and not a real CB native Project file.
Title: Re: CMake Code::Blocks Generator Deprecation
Post by: inversesquare.zip on November 02, 2023, 06:33:30 pm
Is there any plan to support CMake integration then?
Title: Re: CMake Code::Blocks Generator Deprecation
Post by: ollydbg on November 04, 2023, 02:13:00 am
Is there any plan to support CMake integration then?

I don't use CMake in my own projects, so I don't have the motivation to improve this.

If you have the need, or other devs has the motivation, you/they can try to integrate it.

But I still don't know what does the "cmake-file-api" used for.

Title: Re: CMake Code::Blocks Generator Deprecation
Post by: Grit Clef on November 04, 2023, 04:01:20 pm
Is there any plan to support CMake integration then?
But you can still partly use this functionality in CB, by installing someone's plugin.
Title: Re: CMake Code::Blocks Generator Deprecation
Post by: inversesquare.zip on November 05, 2023, 10:12:19 pm
Whose plugin?
Title: Re: CMake Code::Blocks Generator Deprecation
Post by: Grit Clef on November 07, 2023, 01:23:36 pm
https://wiki.codeblocks.org/index.php/Project_Exporter
This website introduces it simply. I remember the latest version can be downloaded from github, but now I can't find the right address...
Title: Re: CMake Code::Blocks Generator Deprecation
Post by: christo on November 08, 2023, 06:21:58 pm
https://wiki.codeblocks.org/index.php/Project_Exporter
This website introduces it simply. I remember the latest version can be downloaded from github, but now I can't find the right address...
This plugin exports the project as CMake, but still plugin to import cmake is not available.
I've collected Project_Exporter source from github and added to https://github.com/josephch/CBProjectExporter . It looks good, needs a bit more polishing. Now  manual edits of generated CMakeLists.txt is required to make it work.
Title: Re: CMake Code::Blocks Generator Deprecation
Post by: Wkerry on November 09, 2023, 10:08:05 am
The repo is not forked and I cannot find where it came from as you said it came from github.

Can you point me at where you "llected Project_Exporter source from github" so I look at the original source.

Thanks.
Title: Re: CMake Code::Blocks Generator Deprecation
Post by: Grit Clef on November 09, 2023, 11:36:13 am
@christo
Thanks for your provision. You do need to modify the generated file, but that is more easier.
Title: Re: CMake Code::Blocks Generator Deprecation
Post by: christo on November 09, 2023, 05:10:28 pm
The repo is not forked and I cannot find where it came from as you said it came from github.

Can you point me at where you "llected Project_Exporter source from github" so I look at the original source.

Thanks.

I got the information  about github project https://github.com/acotty/CodeBlocks_Unofficial_Testing/ from  https://forums.codeblocks.org/index.php/topic,25062.0/prev_next,next.html#new , but I could not access that repo. So I seached for forks of CodeBlocks_Unofficial_Testing and found https://github.com/stahta01/CodeBlocks_Unofficial_Testing . Copied the code from that repo https://github.com/stahta01/CodeBlocks_Unofficial_Testing/tree/master/src/plugins/contrib/ProjectExporter . Hope this helps.
Title: Re: CMake Code::Blocks Generator Deprecation
Post by: Wkerry on November 10, 2023, 08:54:04 am
Thanks.