From c18d4401beb9f4620fd06513da760cabf2a92cfc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christoph=20Gr=C3=BCninger?= <gruenich@dune-project.org>
Date: Tue, 11 Sep 2012 21:32:56 +0000
Subject: [PATCH] [FindSuperLU.cmake] Make sure the function
 add_dune_superlu_flags is always defined.

[[Imported from SVN: r1703]]
---
 cmake/modules/FindSuperLU.cmake | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/cmake/modules/FindSuperLU.cmake b/cmake/modules/FindSuperLU.cmake
index 7b03c9ee..2b17017b 100644
--- a/cmake/modules/FindSuperLU.cmake
+++ b/cmake/modules/FindSuperLU.cmake
@@ -10,6 +10,21 @@
 # SUPERLU_INCLUDE_DIRS    Path to the SuperLU include dirs.
 # SUPERLU_LIBRARIES       Name to the SuperLU library.
 #
+
+# adds SuperLU flags to the targets
+function(add_dune_superlu_flags _targets)
+  if(SUPERLU_FOUND)
+    foreach(_target ${_targets})
+      target_link_libraries(${_target} ${SUPERLU_DUNE_LIBRARIES})
+      GET_TARGET_PROPERTY(_props ${_target} COMPILE_FLAGS)
+      string(REPLACE "_props-NOTFOUND" "" _props "${_props}")
+      SET_TARGET_PROPERTIES(${_target} PROPERTIES COMPILE_FLAGS
+        "${_props} ${SUPERLU_DUNE_COMPILE_FLAGS} -DENABLE_SUPERLU=1")
+    endforeach(_target ${_targets})
+  endif(SUPERLU_FOUND)
+endfunction(add_dune_superlu_flags)
+
+# look for BLAS
 find_package(BLAS QUIET REQUIRED)
 if(NOT BLAS_FOUND)
   message("SuperLU requires BLAS which was not found, skipping the test.")
@@ -113,16 +128,3 @@ endif(SUPERLU_FOUND)
 
 # set HAVE_SUPERLU for config.h
 set(HAVE_SUPERLU SUPERLU_FOUND)
-
-# adds SuperLU flags to the targets
-function(add_dune_superlu_flags _targets)
-  if(SUPERLU_FOUND)
-    foreach(_target ${_targets})
-      target_link_libraries(${_target} ${SUPERLU_DUNE_LIBRARIES})
-      GET_TARGET_PROPERTY(_props ${_target} COMPILE_FLAGS)
-      string(REPLACE "_props-NOTFOUND" "" _props "${_props}")
-      SET_TARGET_PROPERTIES(${_target} PROPERTIES COMPILE_FLAGS
-        "${_props} ${SUPERLU_DUNE_COMPILE_FLAGS} -DENABLE_SUPERLU=1")
-    endforeach(_target ${_targets})
-  endif(SUPERLU_FOUND)
-endfunction(add_dune_superlu_flags)
-- 
GitLab