From: Matthias Maier <tamiko@kyomu.43-1.org>
Date: Fri, 28 Sep 2012 18:55:06 +0000 (+0000)
Subject: Fixups in the Find modules
X-Git-Tag: v8.0.0~1079^2~575
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09eb79f2a380197a999167b1fbf1176db2b7c3ab;p=dealii.git

Fixups in the Find modules

git-svn-id: https://svn.dealii.org/branches/branch_cmake@26858 0785d39b-7218-0410-832d-ea1e28bc413d
---

diff --git a/deal.II/cmake/configure/configure_p4est.cmake b/deal.II/cmake/configure/configure_p4est.cmake
index 0fc4bb2fda..f047747d2c 100644
--- a/deal.II/cmake/configure/configure_p4est.cmake
+++ b/deal.II/cmake/configure/configure_p4est.cmake
@@ -3,17 +3,14 @@
 #
 
 
-SET(FEATURE_P4EST_DEPENDS
-  DEAL_II_WITH_MPI
-  )
+SET(FEATURE_P4EST_DEPENDS DEAL_II_WITH_MPI)
 
 
 MACRO(FEATURE_P4EST_FIND_EXTERNAL var)
 
   FIND_PACKAGE(P4EST)
-  FIND_PACKAGE(SC)
 
-  IF(P4EST_FOUND AND SC_FOUND)
+  IF(P4EST_FOUND)
     #
     # Check whether p4est supports mpi:
     #
@@ -31,22 +28,13 @@ ENDMACRO()
 
 
 MACRO(FEATURE_P4EST_CONFIGURE_EXTERNAL var)
-  INCLUDE_DIRECTORIES(${P4EST_INCLUDE_DIR} ${SC_INCLUDE_DIR})
 
-  # The user has to know the location of the p4est headers as well:
-  LIST(APPEND DEAL_II_USER_INCLUDE_DIRS ${P4EST_INCLUDE_DIR} ${SC_INCLUDE_DIR})
+  INCLUDE_DIRECTORIES(${P4EST_INCLUDE_DIRS})
 
-  IF (CMAKE_BUILD_TYPE MATCHES "Debug")
-    LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_DEBUG
-      ${P4EST_LIBRARY} ${SC_LIBRARY}
-      )
-  ENDIF()
+  # The user has to know the location of the p4est headers as well:
+  LIST(APPEND DEAL_II_USER_INCLUDE_DIRS ${P4EST_INCLUDE_DIRS})
 
-  IF (CMAKE_BUILD_TYPE MATCHES "Release")
-    LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_RELEASE
-      ${P4EST_LIBRARY} ${SC_LIBRARY}
-      )
-  ENDIF()
+  LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${P4EST_LIBRARIES})
 
   SET(DEAL_II_USE_P4EST TRUE)
 
diff --git a/deal.II/cmake/modules/FindBLACS.cmake b/deal.II/cmake/modules/FindBLACS.cmake
deleted file mode 100644
index 08aec84f7b..0000000000
--- a/deal.II/cmake/modules/FindBLACS.cmake
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# Try to find the BLACS library
-#
-# This module exports
-#
-
-INCLUDE(FindPackageHandleStandardArgs)
-
diff --git a/deal.II/cmake/modules/FindMETIS.cmake b/deal.II/cmake/modules/FindMETIS.cmake
index 6a0f0ea19a..1d4180fee1 100644
--- a/deal.II/cmake/modules/FindMETIS.cmake
+++ b/deal.II/cmake/modules/FindMETIS.cmake
@@ -1,11 +1,19 @@
 #
-# Try to find the METIS library
+# Try to find the (serial) METIS library
 #
 
 INCLUDE(FindPackageHandleStandardArgs)
 
 SET_IF_EMPTY(METIS_DIR "$ENV{METIS_DIR}")
 
+#
+# Metis (at least up to version 4.*) is usually pretty self contained. So
+# no external dependencies so far.
+#
+# TODO: What about metis-5.* (e.g. coming from parmetis) This could have
+# deps on pcre and mpi...
+#
+
 FIND_PATH(METIS_INCLUDE_DIR metis.h
   HINTS
     ${METIS_DIR}
diff --git a/deal.II/cmake/modules/FindNETCDF.cmake b/deal.II/cmake/modules/FindNETCDF.cmake
index 752c887228..8130f6c81b 100644
--- a/deal.II/cmake/modules/FindNETCDF.cmake
+++ b/deal.II/cmake/modules/FindNETCDF.cmake
@@ -7,6 +7,10 @@ INCLUDE(FindPackageHandleStandardArgs)
 FIND_PATH(NETCDF_INCLUDE_DIR netcdf.hh
 )
 
+#
+# TODO: netcdf might externally depend on hdf5. Check and fix this.
+#
+
 FIND_LIBRARY(NETCDF_LIBRARY
   NAMES netcdf_c++ netcdf_cpp
   PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
diff --git a/deal.II/cmake/modules/FindP4EST.cmake b/deal.II/cmake/modules/FindP4EST.cmake
index c7f8c6e051..7582f365b0 100644
--- a/deal.II/cmake/modules/FindP4EST.cmake
+++ b/deal.II/cmake/modules/FindP4EST.cmake
@@ -1,11 +1,21 @@
 #
 # Try to find the P4EST library
 #
+# This module exports:
+#   P4EST_LIBRARIES
+#   P4EST_INCLUDE_DIRS
+#   P4EST_WITH_MPI
+#
 
 INCLUDE(FindPackageHandleStandardArgs)
 
 SET_IF_EMPTY(P4EST_DIR "$ENV{P4EST_DIR}")
 
+#
+# Search for the sc library, usually bundled with p4est:
+#
+FIND_PACKAGE(SC)
+
 FIND_PATH(P4EST_INCLUDE_DIR p4est.h
   HINTS
     ${P4EST_DIR}
@@ -21,7 +31,20 @@ FIND_LIBRARY(P4EST_LIBRARY
     lib${LIB_SUFFIX} lib64 lib src
   )
 
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(P4EST DEFAULT_MSG P4EST_LIBRARY P4EST_INCLUDE_DIR)
+SET(P4EST_LIBRARIES
+  ${P4EST_LIBRARIES}
+  ${SC_LIBRARIES}
+  )
+
+SET(P4EST_INCLUDE_DIRS
+  ${P4EST_INCLUDE_DIR}
+  ${SC_INCLUDE_DIR}
+  )
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(P4EST DEFAULT_MSG
+  P4EST_LIBRARIES
+  P4EST_INCLUDE_DIRS
+  )
 
 IF(P4EST_FOUND)
 
diff --git a/deal.II/cmake/modules/FindSC.cmake b/deal.II/cmake/modules/FindSC.cmake
index 4b91378877..f736b0a022 100644
--- a/deal.II/cmake/modules/FindSC.cmake
+++ b/deal.II/cmake/modules/FindSC.cmake
@@ -1,4 +1,6 @@
+#
 # Try to find SC
+#
 
 INCLUDE(FindPackageHandleStandardArgs)
 
diff --git a/deal.II/cmake/modules/FindTRILINOS.cmake b/deal.II/cmake/modules/FindTRILINOS.cmake
index a004fac8cb..37b513f96b 100644
--- a/deal.II/cmake/modules/FindTRILINOS.cmake
+++ b/deal.II/cmake/modules/FindTRILINOS.cmake
@@ -5,7 +5,6 @@
 #
 #   TRILINOS_DIR
 #   TRILINOS_INCLUDE_DIRS
-#   TRILINOS_LIBRARY_*
 #   TRILINOS_LIBRARIES
 #   TRILINOS_VERSION_MAJOR
 #   TRILINOS_VERSION_MINOR
@@ -57,6 +56,12 @@ FOREACH(library ${Trilinos_LIBRARIES})
   FIND_LIBRARY(TRILINOS_LIBRARY_${library}
     NAMES ${library}
     HINTS ${Trilinos_LIBRARY_DIRS}
+    NO_DEFAULT_PATH
+    NO_CMAKE_ENVIRONMENT_PATH
+    NO_CMAKE_PATH
+    NO_SYSTEM_ENVIRONMENT_PATH
+    NO_CMAKE_SYSTEM_PATH
+    NO_CMAKE_FIND_ROOT_PATH
     )
 
   LIST(APPEND TRILINOS_LIBRARIES ${TRILINOS_LIBRARY_${library}})
diff --git a/deal.II/cmake/modules/FindUMFPACK.cmake b/deal.II/cmake/modules/FindUMFPACK.cmake
index 4b22270edf..68060cc408 100644
--- a/deal.II/cmake/modules/FindUMFPACK.cmake
+++ b/deal.II/cmake/modules/FindUMFPACK.cmake
@@ -25,7 +25,7 @@ FIND_PATH(UMFPACK_INCLUDE_DIR umfpack.h
     ${UMFPACK_DIR}
   PATH_SUFFIXES
     umfpack include/umfpack include Include UMFPACK/Include ../UMFPACK/Include
-)
+  )
 
 FIND_LIBRARY(UMFPACK_LIBRARY
   NAMES umfpack
@@ -33,7 +33,7 @@ FIND_LIBRARY(UMFPACK_LIBRARY
     ${UMFPACK_DIR}
   PATH_SUFFIXES
     lib${LIB_SUFFIX} lib64 lib Lib UMFPACK/Lib ../UMFPACK/Lib
-)
+  )
 
 SET(UMFPACK_LIBRARIES
   ${UMFPACK_LIBRARY}