Is ECM a good place for implementing Nim support in CMake?

Anna (cybertailor) Vyalkova cyber+kde at sysrq.in
Fri Apr 19 10:17:09 BST 2024


Hi,

I'd like to develop Nim applications (with possible GUI support via 
nimqt) but this language lacks support for any standard build system.

So that's the thing I'm focused on right now (just happened to also be 
my favorite thing).

Alternatives I considered:

1. Procedure described in "CMakeAddNewLanguage.txt". First of all, 
that's scary and second it doesn't cover my use case: Nim is not a 
compiler but rather a transpiler. It compiles Nim code into C/C++/JS 
code and then calls system compiler to get native binaries. These steps 
could be separated.

2. Going with my own "nim-for-cmake" module library. That's possible but 
requires lots of boilerplate code that can be avoided if these modules 
become part of ECM.

I've implemented an alternative build system for Nim's "nimble" packages 
before so I know the necessary steps: 1) find the compiler, 2) find the 
deps, 3) generate a json-script, 4) extract the depfiles, 5) execute the 
script.

Can I start making such ECM module or should it be a separate CMake 
module library?


More information about the Kde-buildsystem mailing list