I'm looking for a way to automatically generate a header file. This file is the public interface of a library and i want to "fill" some structures and stuff before compilation.
For example, in the private header I have a structure with useful fields :
typedef struct mystuff_attr_t {
int _detachstate;
mystuff_scope_t _scope;
cpu_set_t _cpuset;
size_t _stacksize;
void* _stackaddr;
} mystuff_attr_t;
And I would like to have this structure in the public header without the fields but with the same size (currently done manually) this way :
typedef struct mystuff_attr_t {
char _opaque[ 20 ];
} mystuff_attr_t;
I would like to have this automatically generated by CMake when creating the build system in order to avoid bad size struct in public interface when I change the struct in private header.