Is it possible to get CMake to build both a static and shared library at the same time?

Yes, it’s moderately easy. Just use two “add_library” commands: add_library(MyLib SHARED source1.c source2.c) add_library(MyLibStatic STATIC source1.c source2.c) Even if you have many source files, you can place the list of sources in a Cmake variable, so it’s still easy to do. On Windows you should probably give each library a different name, since there is … Read more