Author Topic: C::B Workspace/project to cmake or premake?  (Read 9739 times)

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: C::B Workspace/project to cmake or premake?
« Reply #15 on: February 08, 2024, 09:48:49 pm »
CMake is the future! Finally the C++ world is getting some sort of standard build system that does not only drive automated builds but can also be used by any IDE. Finally you don't have to maintain multiple build systems to make your CI and users happy.

However, this requires that your favorite IDE does support CMake, which CodeBlocks currently doesn't, and it doesn't look like it will in the near future.
I have had the mixed pleasure of using CMake integrated into VScode for C++ development. What I said earlier in this thread still stands. Using CMake hasn't convinced me it is the future, on the contrary.

By the way I did write a C::B to premake plugin to test out the idea
https://gitlab.com/arnholm/premake5cb
« Last Edit: February 08, 2024, 09:50:22 pm by cacb »

Offline sodev

  • Regular
  • ***
  • Posts: 497
Re: C::B Workspace/project to cmake or premake?
« Reply #16 on: February 08, 2024, 10:58:17 pm »
There is definately a learning curve using CMake, this out-of-tree approach feels pretty strange when you are used to the in-tree approach, but today i don't want to go back anymore. I was using CodeBlocks + Premake for around 10 years (in the beginning without Premake) but in the opposite direction like your plugin, Premake was my source and i generated CodeBlocks projects and Makefiles from it. CMake is still not there in the C++ world where Gradle is in the Java world, due to the nature of native code probably will never be, but i like the progress i see. Yes, i remember the past when i was annoyed about that CMakeLists.txt file in libraries i wanted to use and looked for alternatives, now im annoyed when that file is not there :).

About other IDEs with CMake integration, there is an overview here, the only one i am really using is VSCode. Yes, there is also a learning curve, especially if you are used to classic desktop applications, maybe its easier for "digital natives" who have never seen anything else than web-stuff :P. But once you found the proper extensions and made the right settings, its a pretty awesome IDE :).

Offline Wkerry

  • Multiple posting newcomer
  • *
  • Posts: 44
Re: C::B Workspace/project to cmake or premake?
« Reply #17 on: February 09, 2024, 09:08:57 am »
If you want to use CMAKE seach the forum for CMAKE plugins and ask why has it not progressed as I have no idea what happened to the dev who was working on it last.

Offline user2024

  • Single posting newcomer
  • *
  • Posts: 6
Re: C::B Workspace/project to cmake or premake?
« Reply #18 on: February 09, 2024, 01:25:57 pm »

By the way I did write a C::B to premake plugin to test out the idea

And what about the opposite direction, premake to C::B?

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: C::B Workspace/project to cmake or premake?
« Reply #19 on: February 10, 2024, 11:02:46 am »

By the way I did write a C::B to premake plugin to test out the idea

And what about the opposite direction, premake to C::B?
They do exist, I have one installed under Kubuntu 22.04
https://github.com/chris-be/premake-codeblocks

These days I just use Code::Blocks.

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: C::B Workspace/project to cmake or premake?
« Reply #20 on: February 10, 2024, 10:16:36 pm »
Slightly off topic comment: On the principles of build systems, I like the ideas put forward in this video

Better Way to Build C
https://www.youtube.com/watch?v=mLUhSPD4F2k

It is not a fully developed idea and if I did it I would use simple C++. But one important argument is why use an 'incomprehensible' script like CMake when you already have a much more powerful and familiar language like C++ when you are developing a C++ application?. The whole build system could be simple C++ source code which is easily bootstrapped and used for building an application.  It even knows which compiler used for bootstrapping it and will be used for building the application. Something like that seems appealing even as an incomplete idea.

Offline user2024

  • Single posting newcomer
  • *
  • Posts: 6
Re: C::B Workspace/project to cmake or premake?
« Reply #21 on: February 10, 2024, 11:29:02 pm »

They do exist, I have one installed under Kubuntu 22.04
https://github.com/chris-be/premake-codeblocks

These days I just use Code::Blocks.
And can this thing turn this cmakelist.txt into a Code::Blocks? Does it only work on Linux and only with this clang?