Force CMake to use static libraries
问题 [Shamelessly cross-posted from the CMake help list] I'm trying to create binaries as statically as possible. The fortran code I've got has got X11 and quadmath as dependencies, and I've come across a number of issues (maybe each of these issues should be in a different question?): My variables are currently set(CMAKE_LIBRARY_PATH /usr/X11/lib /usr/X11/include/X11 ${CMAKE_LIBRARY_PATH}) find_package(X11 REQUIRED) find_library(X11 NAMES X11.a PATHS /usr/X11/include/X11/ /usr/X11/lib) find