May be you can try to use the pre-build steps (Project-->Build options-->Commands).
I try it, but these command are only executed once globally, so to use this i would have to input all header link commands there separately (it would be very long list).
I found out that i can create a custom compile command for each needed header file separately (Options for files), set priority, check Compile box and insert custom compile option... but this is pain. I have more than 50 headers to do that and if i want to rearrange sources in future? I would have to modify each of these commands independently.
Another problem is config.h file, how can i parse sth like that? Till now i use cmake for management, makefile creation and config.h file creation.
But still i have some other questions. In target options, selected build target files are used as a target dependencies? If i deselect some headers and make changes in them, do sources that depend on these headers would be recompiled?