I\'m using CMake in a project, and I\'m trying to statically link some libraries. I\'ve set:
set(BUILD_SHARED_LIBS OFF)
set(CMAKE_EXE_LINKER_FLAGS \"-static-
How do I setup for static linkage using CMake
Well... you don't :) That's not how CMake works: in CMake, you first find the absolute path of a library, then link to it with target_link_libraries.
So, if you want to link to a static library, you need to search for that static library:
find_library(SOMELIB libsomelib.a)
instead of:
find_library(SOMELIB somelib)