From 35cce32df2b88c2aaf68abb3cbc7385c23b8ecfd Mon Sep 17 00:00:00 2001 From: Szilard Pall Date: Thu, 8 Nov 2012 20:30:18 +0100 Subject: [PATCH] also preferentiate .lib with GMX_PREFER_STATIC_LIBS On Mac OS X GMX_PREFER_STATIC_LIBS was enabled by caca171. On Mac OS X .lib is also used as suffix for static archives (as well as .a), this commits adds .lib to the preferred library suffixes. Change-Id: I39e8df212355f6b199de4f93abd29275babdfe96 --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e3a9c41eec..3579113f6c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -200,7 +200,7 @@ mark_as_advanced(USE_VERSION_H) option(GMX_DEFAULT_SUFFIX "Use default suffixes for GROMACS binaries and libs (_d for double, _mpi for MPI; rerun cmake after changing to see relevant options)" ON) if(UNIX) - option(GMX_PREFER_STATIC_LIBS "When finding libraries prefer \".a\" static archives (NOTE: this is enabled only for UNIX platforms but it might not always work!" OFF) + option(GMX_PREFER_STATIC_LIBS "When finding libraries prefer static archives (not available on non-*nix platforms and it will only work if static versions of external dependencies are available and found)!" OFF) mark_as_advanced(GMX_PREFER_STATIC_LIBS) endif() @@ -473,7 +473,9 @@ test_big_endian(GMX_INTEGER_BIG_ENDIAN) ######################################################################## if(UNIX) if(GMX_PREFER_STATIC_LIBS) - SET(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) + # On Linux .a is the static library suffix, on Mac OS X .lib can also + # be used, so we'll add both to the preference list. + SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib;.a" ${CMAKE_FIND_LIBRARY_SUFFIXES}) if(SHARED_LIBS_DEFAULT) if(BUILD_SHARED_LIBS) #Warn the user about the combination. But don't overwrite the request. message(WARNING "Static libraries requested, and shared Gromacs libraries requested.") -- 2.22.0