I have an install component ae_sdk
that produces the client-facing SDK. We want the SDK to contains the minimal set of headers required. Currently we achieve this by compiling a sample SDK project with the gcc -H
flag (print header dependencies) and manually reduce this output down to the minimal set of SDK headers, then manually update the cmake header set, finally producing something like this:
target_sources (ae_core PUBLIC
FILE_SET public_sdk_headers
TYPE HEADERS
FILES
Atomic.hpp
Exception.hpp
Logger.hpp
OS.hpp
TimeStamp.hpp
Utils.hpp
SpinLock.hpp
Lock.hpp
ConcurrentBuffer.hpp
CircleBuffer.hpp)
This is quite cumbersome and needs to be repeated whenever the SDK changes. Has anyone seen a way to automate this process? AFAIK cmake does not offer any features along these lines.
My first thought was to write a cmake module that attempts to automate our manual gcc -H
approach. Any insights or experience appreciated.