Making CMake choose static linkage when possible?
I'm working on a project that's link against SOCI, which comes as both static and dynamic libraries. I'd like CMake to choose the static version when available, and dynamic otherw开发者_Go百科ise. Is there a reasonable way to do this in CMake? I've come up with nothing looking through the docs so far.
Sounds like you need to add CMAKE_EXE_LINKER_FLAGS=-static
精彩评论