Skip to content

remove cmate in favour of native CMake + CPM#432

Draft
daantimmer wants to merge 8 commits into
mainfrom
cpp-remove-cmate-use-native-cmake-and-CPM
Draft

remove cmate in favour of native CMake + CPM#432
daantimmer wants to merge 8 commits into
mainfrom
cpp-remove-cmate-use-native-cmake-and-CPM

Conversation

@daantimmer

@daantimmer daantimmer commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

🤔 What's changed?

  • Removed custom cmate scripts and replaced it with native cmake instead
  • Use Cmake Package Manager (CPM) to (optionally) download nlohmann/json
  • Update cpp.hpp.erb codegen to indent properly
  • Update cpp.hpp.erb to treat all functions equal on where the return type should be located (same line instead of separate line)
  • Update codegen to write to separate folders. Separating custom maintained sources/headers and generated files to make the maintenance work more streamlined. (The manually maintained sources are easily overlooked)

⚡️ What's your motivation?

The custom cmate script adds no value and only confusion on maintaining the cpp codebase. Secondly its an unmaintained script by a third party.

As for the codegen, there were some inconsistencies.

🏷️ What kind of change is this?

  • 🏦 Refactoring/debt/DX (improvement to code design, tooling, etc. without changing behaviour)

♻️ Anything particular you want feedback on?

I am not too sure about the separation of generated vs non-generated code. It makes reading and maintaining a lot easier. However it does mean that this is a very large change because of all the file moves.

Regarding the checklist's #pragma once todo item. This is a highly debated topic in C++ land. However as a public library we should follow the core guidelines as closely as possible, and thus follow the rule: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#sf8-use-include-guards-for-all-header-files

I can, if preferred, do this in a separate pull request.

On that note I'll also add tooling (in a separate PR) to check for compliancy with the c++ core guidelines.

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.
  • Update supporting code to maintain a consistent coding style
  • Update test-cpp to actually use different clang and gcc versions
  • Replace #pragma once with proper include guards.
    • or create separate PR
  • Tooling for checking core guidelines
    • or create separate PR

This text was originally generated from a template, then edited by hand. You can modify the template here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant