I know this might be a long shot, but here it goes. I have several active projects and each has sub project library which gets compiled when the main project compiles. These libraries are dynamic ones, but recently there was an issue that might arise a need for those libraries (most of them are shared between projects) to be static instead of dynamic.
Now, I am quite sure someone has devised a system where I could make a library which could be compiled wither as static into the project or dynamic one with something like a simple preprocessor directive or something. If not, I'll pipe dream away.
edit:
looks like CMake might be it, however, apart from building stuff I would also like to alleviate __declspec(dllimport) and __declspec(dllexport) from my code - so that I can automatically switch between static and dynamic. Although it is fairly easy to do with preprocessor macros, I thought maybe there might be some form of a system already in use by people?