Hi all,
I have many Code::Blocks workspaces and enjoy the IDE, thanks for the great work done by the C::B developers! Sometimes, however, I need to share my work with others who do not use Code::Blocks. Some people expect Visual Studio solutions for example, so I was considering how to do it.
It was suggested to me to maintain a separate CMake script along the C::B workspace/projects, but that idea did not appeal to me. I do want the convenience of Code::Blocks, I don't want to maintain a parallel build system and finally I think the CMake syntax is awful and difficult. Therefore, a different idea was instead to create a Code::Blocks plugin to automatically generate a
Premake5 script, because Premake5 seems well structured and well documented. It can generate GNU makefiles as well as Visual Studio solutions. Thus, the idea of
Premake5 exporter plugin for Code::Blocks was born.
Of course, some will say this can never work and it is a bad idea. In a way it is true, because there will always be examples that don't work properly. Still, if I can apply some assumptions and make it work for my Code::Blocks workspaces, it is still useful to me, and quite possibly to others as well.
You can find the plugin at
https://github.com/arnholm/premake5cb , please see the README documentation with screenshots there.
An example Code::Blocks workspace at
https://github.com/arnholm/pm5example1 .
The plugin currently builds on Linux only, it is possible that the project file does not correspond 100% to other plugins, I had to tweak it to make it work, but it does work fine here, and it is even possible to generate the required Visual Studio solution with premake5 under Linux.
If you have constructive suggestions, please share. This is somewhat experimental at this stage!