nowox
nowox

Reputation: 29096

Are Cmake/Autotools useful for non standard compilers?

I am working on a complex project written in C/Asm for an embedded target running on an Analog Devices DSP. The toolchain is close to gcc, but they are plenty of differences. Moreover, I am using a lot of autogeneration scripts using Jinja2 to generate header files from data extracted from a database. I also have plenty of compiler flags.

I currently wrote a Makefile from scratch. It is about 400 lines long and works pretty well. I automatically discover the sources across the directories and hold all the dependencies i.e.

a.tmpl --->jinja-->a.c--->a.o
             ^
a.yaml ------'

I would like to know if tools such as Cmake or Automake can be useful in my case. In other words, can I use these tools to simply the readability of Makefile?

Upvotes: 0

Views: 136

Answers (1)

Tsyvarev
Tsyvarev

Reputation: 65928

CMake works perfectly with generated sources. Just add appropriate custom command:

add_custom_command(OUTPUT a.c
    COMMAND jinja <args>
    DEPENDS a.yaml)

add_executable(a a.c)

Upvotes: 1

Related Questions