]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Prefer static archives if BUILD_SHARED_LIBS is set to off
authorMatthias Maier <tamiko@kyomu.43-1.org>
Thu, 11 Jul 2013 11:52:21 +0000 (11:52 +0000)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Thu, 11 Jul 2013 11:52:21 +0000 (11:52 +0000)
git-svn-id: https://svn.dealii.org/trunk@29964 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/setup_deal_ii.cmake

index 5b82eedd223bbf758b4a95081d6fba4d974ca775..d517590f5de03d749aee7d089ac6809e6a8ad0d2 100644 (file)
@@ -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:

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.