I want to generate a custom header file and was wondering if CMake has something that I can use without writing my own generator. It would have some "one time" items and some items I need to generate based on a loop.
For example, the desired output would look like:
//One time stuff
#define ABC 1
#define DEF 2
#define GHI 3
#define JKL 4
//Stuff generated in loop
//Iteration with params Item1, 1, 2
const int prefix_Item1_1 = 2;
const int prefix2_1_2 = 0;
//Iteration with params Item2, 3, 4
const int prefix_Item2_3 = 4;
const int prefix2_3_4 = 0;
//Iteration with params Item5, 6, 7
const int prefix_Item5_6 = 7;
const int prefix2_6_7 = 0;
For input, I would provide the following in some form:
Item1, 1, 2
Item2, 3, 4
Item5, 6, 7