From 6b7ac4b37f6a3ed752e1db1e1be1a98b6ad6f19f Mon Sep 17 00:00:00 2001 From: Riccardo Spagni Date: Mon, 6 Oct 2014 18:46:18 +0200 Subject: [PATCH] enforce static libraries when building statically --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index b9bcc411c..54565464c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,6 +87,14 @@ else() endif() set(STATIC ${DEFAULT_STATIC} CACHE BOOL "Link libraries statically") +IF(STATIC) + IF(MSVC) + SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll.a .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) + ELSE() + SET(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) + ENDIF() +ENDIF() + if (UNIX AND NOT APPLE) # Note that at the time of this writing the -Wstrict-prototypes flag added below will make this fail find_package(Threads)