Real-world CMake and C++Builder applications on github

by May 31, 2018

Last week, we ran a popular webinar Fast Builds and Integrating Libraries: Using CMake and Ninja for C++ Builder 10.2.3.  The replay is now available on Youtube.

In it, I demonstrated two items building with C++Builder and our CMake support: a real-world FireMonkey application, and Google Test.  These are available on github:

  • Mazes: I wrote this for CodeRage XII in 2017 and the same application is available for both Delphi and C++Builder, written in duplicate.  If you are a Delphi user interested in C++, you may find it interesting for that reason, or vice versa.  The C++ application contains a CMakeLists.txt file and is an app I use often to demonstrate our CMake support.  It's small but non-trivial, ie is a real-world application, and is worth checking out if you want to see a real application building with CMake.
  • Google Test and Google Mocks: this is an example of a common third party C++ library that was not written with specific C++Builder support.  An intern here, Nikolay Avramov, has been doing great work going through common libraries and making sure they work with C++Builder, and one of those libraries is Google Test.  Typically, you find that C++ libraries have a couple of things you need to fix: it assumes if it's Windows, it's using MSVC (not true, could be us or MinGW): this requires you fix macros in a header; or it makes similar assumptions about headers or RTL method names: here you need to append or remove a _ for some RTL methods, or add or remove a header.  Both types of fixes are straightforward, you just build, track down the incorrect logic, and fix — and ideally submit a pull request back 🙂

CMake support opens up C++Builder to the wide world of C++ and the ability to add third party C++ libraries to your applications is very valuable.  We've had a lot of very positive feedback about this, and we look forward to what we'll do next in this area.