From 34bb0a145ae20d03974126177647df5f18fbd0d7 Mon Sep 17 00:00:00 2001 From: maier Date: Thu, 11 Jul 2013 11:52:21 +0000 Subject: [PATCH] CMake: Prefer static archives if BUILD_SHARED_LIBS is set to off git-svn-id: https://svn.dealii.org/trunk@29964 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/cmake/setup_deal_ii.cmake | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/deal.II/cmake/setup_deal_ii.cmake b/deal.II/cmake/setup_deal_ii.cmake index 5b82eedd22..d517590f5d 100644 --- a/deal.II/cmake/setup_deal_ii.cmake +++ b/deal.II/cmake/setup_deal_ii.cmake @@ -147,7 +147,7 @@ ENDIF() ########################################################################### # # -# Cleanup and Includes that have to happen after the call to PROJECT(): # +# Cleanup and setup that has to happen after the call to PROJECT(): # # # ########################################################################### @@ -164,6 +164,14 @@ FOREACH(_build ${DEAL_II_BUILD_TYPES}) ) ENDFOREACH() +# +# Invert the search order for libraries when BUILD_SHARED_LIBS=OFF to +# prefer static archives instead of shared libraries: +# +IF(NOT BUILD_SHARED_LIBS) + # TODO: Does this work on a Windows or CYGWIN target? + LIST(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES) +ENDIF() # # Cross compilation stuff: -- 2.39.5