From: Matthias Maier Date: Thu, 11 Jul 2013 11:52:21 +0000 (+0000) Subject: CMake: Prefer static archives if BUILD_SHARED_LIBS is set to off X-Git-Tag: v8.0.0~156 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=13d11db0c1c83376a49170e45cbd12bb66b7f61d;p=dealii.git 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 --- 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: