From: Matthias Maier <tamiko@kyomu.43-1.org>
Date: Sat, 26 Apr 2014 12:28:38 +0000 (+0000)
Subject: CMake: Some minor cleanup
X-Git-Tag: v8.2.0-rc1~545
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb5afc6f1f0f7f3a8c1e0f1b3368575d95ef15f8;p=dealii.git

CMake: Some minor cleanup

git-svn-id: https://svn.dealii.org/trunk@32843 0785d39b-7218-0410-832d-ea1e28bc413d
---

diff --git a/deal.II/cmake/configure/configure_1_bzip2.cmake b/deal.II/cmake/configure/configure_1_bzip2.cmake
index a905aad144..37a0f81305 100644
--- a/deal.II/cmake/configure/configure_1_bzip2.cmake
+++ b/deal.II/cmake/configure/configure_1_bzip2.cmake
@@ -15,7 +15,7 @@
 ## ---------------------------------------------------------------------
 
 #
-# Configuration for the zlib library:
+# Configuration for the bzip2 library:
 #
 
 MACRO(FEATURE_BZIP2_FIND_EXTERNAL var)
diff --git a/deal.II/cmake/modules/FindARPACK.cmake b/deal.II/cmake/modules/FindARPACK.cmake
index 7e8da72090..61af946b96 100644
--- a/deal.II/cmake/modules/FindARPACK.cmake
+++ b/deal.II/cmake/modules/FindARPACK.cmake
@@ -29,6 +29,7 @@
 
 INCLUDE(FindPackageHandleStandardArgs)
 
+SET(ARPACK_DIR "" CACHE PATH "An optional hint to an ARPACK installation")
 SET_IF_EMPTY(ARPACK_DIR "$ENV{ARPACK_DIR}")
 
 FIND_LIBRARY(ARPACK_LIBRARY
@@ -51,18 +52,9 @@ MARK_AS_ADVANCED(
   )
 
 IF(ARPACK_FOUND)
-  SET(ARPACK_LIBRARIES
-    ${ARPACK_LIBRARY}
-    ${LAPACK_LIBRARIES}
-    )
-  SET(ARPACK_LINKER_FLAGS
-    ${LAPACK_LINKER_FLAGS}
-    )
+  SET(ARPACK_LIBRARIES ${ARPACK_LIBRARY} ${LAPACK_LIBRARIES})
+  SET(ARPACK_LINKER_FLAGS ${LAPACK_LINKER_FLAGS})
 
   MARK_AS_ADVANCED(ARPACK_DIR)
-ELSE()
-  SET(ARPACK_DIR "" CACHE PATH
-    "An optional hint to an ARPACK installation"
-    )
 ENDIF()
 
diff --git a/deal.II/cmake/modules/FindDEALII_LAPACK.cmake b/deal.II/cmake/modules/FindDEALII_LAPACK.cmake
index b16cf25b13..69a24aed6c 100644
--- a/deal.II/cmake/modules/FindDEALII_LAPACK.cmake
+++ b/deal.II/cmake/modules/FindDEALII_LAPACK.cmake
@@ -34,19 +34,16 @@
 # We have to use a trick with CMAKE_PREFIX_PATH to make LAPACK_DIR and
 # BLAS_DIR work...
 #
+SET(LAPACK_DIR "" CACHE PATH "An optional hint to a LAPACK installation")
+SET(BLAS_DIR "" CACHE PATH "An optional hint to a BLAS installation")
 SET_IF_EMPTY(BLAS_DIR "$ENV{BLAS_DIR}")
 SET_IF_EMPTY(LAPACK_DIR "$ENV{LAPACK_DIR}")
 
 SET(_cmake_prefix_path_backup "${CMAKE_PREFIX_PATH}")
-
 SET(CMAKE_PREFIX_PATH ${BLAS_DIR} ${LAPACK_DIR} ${_cmake_prefix_path_backup})
-
 FIND_PACKAGE(BLAS)
-
 SET(CMAKE_PREFIX_PATH ${LAPACK_DIR} ${_cmake_prefix_path_backup})
-
 FIND_PACKAGE(LAPACK)
-
 SET(CMAKE_PREFIX_PATH ${_cmake_prefix_path_backup})
 
 MARK_AS_ADVANCED(
@@ -107,26 +104,15 @@ IF(LAPACK_FOUND)
   ENDIF()
   LIST(REMOVE_ITEM LAPACK_LIBRARIES "FALSE")
 
-  MARK_AS_ADVANCED(
-    BLAS_DIR
-    LAPACK_DIR
-    )
+  MARK_AS_ADVANCED( BLAS_DIR LAPACK_DIR)
 
 ELSE()
   SET(DEALII_LAPACK_FOUND FALSE)
 
-  SET(LAPACK_DIR "" CACHE PATH
-    "An optional hint to a LAPACK installation"
-    )
-  SET(BLAS_DIR "" CACHE PATH
-    "An optional hint to a BLAS installation"
-    )
-
   #
   # Clean up the library variables in case we couldn't find the libraries
   # to avoid spurious inclusions of "-NOTFOUND" or "FALSE":
   #
   SET(BLAS_LIBRARIES)
   SET(LAPACK_LIBRARIES)
-
 ENDIF()
diff --git a/deal.II/cmake/modules/FindHDF5.cmake b/deal.II/cmake/modules/FindHDF5.cmake
index 66417e3c33..b3437c9952 100644
--- a/deal.II/cmake/modules/FindHDF5.cmake
+++ b/deal.II/cmake/modules/FindHDF5.cmake
@@ -26,6 +26,7 @@
 
 INCLUDE(FindPackageHandleStandardArgs)
 
+SET(HDF5_DIR "" CACHE PATH "An optional hint to an hdf5 directory")
 SET_IF_EMPTY(HDF5_DIR "$ENV{HDF5_DIR}")
 
 FIND_PATH(HDF5_INCLUDE_DIR hdf5.h
@@ -74,20 +75,15 @@ MARK_AS_ADVANCED(
   )
 
 IF(HDF5_FOUND)
-  SET(HDF5_INCLUDE_DIRS
-    ${HDF5_INCLUDE_DIR}
-    )
-  SET(HDF5_LIBRARIES
-    ${HDF5_HL_LIBRARY}
-    ${HDF5_LIBRARY}
-    ${MPI_C_LIBRARIES} # for good measure
-    )
+  SET(HDF5_INCLUDE_DIRS ${HDF5_INCLUDE_DIR})
+  SET(HDF5_LIBRARIES ${HDF5_HL_LIBRARY} ${HDF5_LIBRARY} ${MPI_C_LIBRARIES})
 
   #
   # Is hdf5 compiled with support for mpi?
   #
   FILE(STRINGS ${HDF5_PUBCONF} HDF5_MPI_STRING
-    REGEX "#define.*H5_HAVE_PARALLEL 1")
+    REGEX "#define.*H5_HAVE_PARALLEL 1"
+    )
   IF("${HDF5_MPI_STRING}" STREQUAL "")
     SET(HDF5_WITH_MPI FALSE)
   ELSE()
@@ -95,9 +91,5 @@ IF(HDF5_FOUND)
   ENDIF()
 
   MARK_AS_ADVANCED(HDF5_DIR)
-ELSE()
-  SET(HDF5_DIR "" CACHE PATH
-    "An optional hint to an hdf5 directory"
-    )
 ENDIF()
 
diff --git a/deal.II/cmake/modules/FindMETIS.cmake b/deal.II/cmake/modules/FindMETIS.cmake
index 005905aecc..a5d9e2ab18 100644
--- a/deal.II/cmake/modules/FindMETIS.cmake
+++ b/deal.II/cmake/modules/FindMETIS.cmake
@@ -29,6 +29,7 @@
 
 INCLUDE(FindPackageHandleStandardArgs)
 
+SET(METIS_DIR "" CACHE PATH "An optional hint to a metis directory")
 SET_IF_EMPTY(METIS_DIR "$ENV{METIS_DIR}")
 
 #
@@ -77,7 +78,6 @@ MARK_AS_ADVANCED(
   )
 
 IF(METIS_FOUND)
-
   #
   # Sanity check: Only include parmetis library if it is in the same
   # directory as the metis library...
@@ -121,9 +121,4 @@ IF(METIS_FOUND)
     )
 
   MARK_AS_ADVANCED(METIS_DIR)
-ELSE()
-  SET(METIS_DIR "" CACHE PATH
-    "An optional hint to a metis directory"
-    )
 ENDIF()
-
diff --git a/deal.II/cmake/modules/FindMUMPS.cmake b/deal.II/cmake/modules/FindMUMPS.cmake
index d3ae910fe7..f8de1f5154 100644
--- a/deal.II/cmake/modules/FindMUMPS.cmake
+++ b/deal.II/cmake/modules/FindMUMPS.cmake
@@ -28,6 +28,7 @@
 #   MUMPS_VERSION_SUBMINOR
 #
 
+SET(MUMPS_DIR "" CACHE PATH "An optional hint to a mumps directory")
 SET_IF_EMPTY(MUMPS_DIR "$ENV{MUMPS_DIR}")
 
 INCLUDE(FindPackageHandleStandardArgs)
@@ -105,29 +106,21 @@ MARK_AS_ADVANCED(
   DMUMPS_LIBRARY
   MUMPS_COMMON_LIBRARY
   MUMPS_INCLUDE_DIR
-  PORT_LIBRARY
+  PORD_LIBRARY
   )
 
 IF(MUMPS_FOUND)
-  SET(MUMPS_INCLUDE_DIRS
-    ${MUMPS_INCLUDE_DIR}
-    )
+  SET(MUMPS_INCLUDE_DIRS ${MUMPS_INCLUDE_DIR})
   SET(MUMPS_LIBRARIES
     ${DMUMPS_LIBRARY}
     ${MUMPS_COMMON_LIBRARY}
     ${PORD_LIBRARY}
     ${SCALAPACK_LIBRARIES}
-    ${METIS_LIBRARIES}       # for good measure
-    ${MPI_Fortran_LIBRARIES} # for good measure
-    )
-  SET(MUMPS_LINKER_FLAGS
-    ${SCALAPACK_LINKER_FLAGS}
+    ${METIS_LIBRARIES}
+    ${MPI_Fortran_LIBRARIES}
     )
+  SET(MUMPS_LINKER_FLAGS ${SCALAPACK_LINKER_FLAGS})
 
   MARK_AS_ADVANCED(MUMPS_DIR)
-ELSE()
-  SET(MUMPS_DIR "" CACHE PATH
-    "An optional hint to a mumps directory"
-    )
 ENDIF()
 
diff --git a/deal.II/cmake/modules/FindMUPARSER.cmake b/deal.II/cmake/modules/FindMUPARSER.cmake
index 6bf17d2dc9..d9d15635d1 100644
--- a/deal.II/cmake/modules/FindMUPARSER.cmake
+++ b/deal.II/cmake/modules/FindMUPARSER.cmake
@@ -29,6 +29,7 @@
 
 INCLUDE(FindPackageHandleStandardArgs)
 
+SET(MUPARSER_DIR "" CACHE PATH "An optional hint to a MUPARSER installation")
 SET_IF_EMPTY(MUPARSER_DIR "$ENV{MUPARSER_DIR}")
 
 FIND_LIBRARY(MUPARSER_LIBRARY
@@ -68,8 +69,4 @@ IF(MUPARSER_FOUND)
     )
 
   MARK_AS_ADVANCED(MUPARSER_DIR)
-ELSE()
-  SET(MUPARSER_DIR "" CACHE PATH
-    "An optional hint to a MUPARSER installation"
-    )
 ENDIF()
diff --git a/deal.II/cmake/modules/FindNETCDF.cmake b/deal.II/cmake/modules/FindNETCDF.cmake
index 066decd95e..3ab2650229 100644
--- a/deal.II/cmake/modules/FindNETCDF.cmake
+++ b/deal.II/cmake/modules/FindNETCDF.cmake
@@ -25,6 +25,7 @@
 
 INCLUDE(FindPackageHandleStandardArgs)
 
+SET(NETCDF_DIR "" CACHE PATH "An optional hint to a NETCDF installation")
 SET_IF_EMPTY(NETCDF_DIR "$ENV{NETCDF_DIR}")
 
 FIND_PATH(NETCDF_INCLUDE_DIR netcdfcpp.h
@@ -70,17 +71,8 @@ MARK_AS_ADVANCED(
   )
 
 IF(NETCDF_FOUND)
-  SET(NETCDF_INCLUDE_DIRS
-    ${NETCDF_INCLUDE_DIR}
-    )
-  SET(NETCDF_LIBRARIES
-    ${NETCDF_CPLUSPLUS_LIBRARY}
-    ${NETCDF_C_LIBRARY}
-    )
+  SET(NETCDF_INCLUDE_DIRS ${NETCDF_INCLUDE_DIR})
+  SET(NETCDF_LIBRARIES ${NETCDF_CPLUSPLUS_LIBRARY} ${NETCDF_C_LIBRARY})
 
   MARK_AS_ADVANCED(NETCDF_DIR)
-ELSE()
-  SET(NETCDF_DIR "" CACHE PATH
-    "An optional hint to a NETCDF installation"
-    )
 ENDIF()
diff --git a/deal.II/cmake/modules/FindP4EST.cmake b/deal.II/cmake/modules/FindP4EST.cmake
index c7cab6ed1f..db72bb2268 100644
--- a/deal.II/cmake/modules/FindP4EST.cmake
+++ b/deal.II/cmake/modules/FindP4EST.cmake
@@ -30,6 +30,9 @@
 
 INCLUDE(FindPackageHandleStandardArgs)
 
+SET(P4EST_DIR "" CACHE PATH
+  "An optional hint to a p4est installation/directory"
+  )
 SET_IF_EMPTY(P4EST_DIR "$ENV{P4EST_DIR}")
 SET_IF_EMPTY(SC_DIR "$ENV{SC_DIR}")
 
@@ -158,7 +161,6 @@ IF(P4EST_FOUND)
   IF("${P4EST_MPI_STRING}" STREQUAL "")
     SET(P4EST_WITH_MPI FALSE)
   ELSE()
-
     SET(P4EST_WITH_MPI TRUE)
   ENDIF()
 
@@ -191,11 +193,5 @@ IF(P4EST_FOUND)
     SET(P4EST_VERSION_PATCH "0")
   ENDIF()
 
-
   MARK_AS_ADVANCED(P4EST_DIR)
-ELSE()
-  SET(P4EST_DIR "" CACHE PATH
-    "An optional hint to a p4est installation/directory"
-    )
 ENDIF()
-
diff --git a/deal.II/cmake/modules/FindPETSC.cmake b/deal.II/cmake/modules/FindPETSC.cmake
index df83255e4d..242a510d90 100644
--- a/deal.II/cmake/modules/FindPETSC.cmake
+++ b/deal.II/cmake/modules/FindPETSC.cmake
@@ -34,6 +34,8 @@
 
 INCLUDE(FindPackageHandleStandardArgs)
 
+SET(PETSC_DIR "" CACHE PATH "An optional hint to a PETSc directory")
+SET(PETSC_ARCH "" CACHE STRING "An optional hint to a PETSc arch")
 SET_IF_EMPTY(PETSC_DIR "$ENV{PETSC_DIR}")
 SET_IF_EMPTY(PETSC_ARCH "$ENV{PETSC_ARCH}")
 
@@ -182,10 +184,7 @@ MARK_AS_ADVANCED(
   )
 
 IF(PETSC_FOUND)
-  SET(PETSC_LIBRARIES
-    ${PETSC_LIBRARY}
-    ${_petsc_libraries}
-    )
+  SET(PETSC_LIBRARIES ${PETSC_LIBRARY} ${_petsc_libraries})
   SET(PETSC_INCLUDE_DIRS
     ${PETSC_INCLUDE_DIR_COMMON}
     ${PETSC_INCLUDE_DIR_ARCH}
@@ -257,12 +256,5 @@ IF(PETSC_FOUND)
     )
 
   MARK_AS_ADVANCED(PETSC_ARCH PETSC_DIR)
-ELSE()
-  SET(PETSC_DIR "" CACHE PATH
-    "An optional hint to a PETSc directory"
-    )
-  SET(PETSC_ARCH "" CACHE STRING
-    "An optional hint to a PETSc arch"
-    )
 ENDIF()
 
diff --git a/deal.II/cmake/modules/FindSCALAPACK.cmake b/deal.II/cmake/modules/FindSCALAPACK.cmake
index 19af21abf8..9d91be55a6 100644
--- a/deal.II/cmake/modules/FindSCALAPACK.cmake
+++ b/deal.II/cmake/modules/FindSCALAPACK.cmake
@@ -25,6 +25,8 @@
 #   SCALAPACK_LINKER_FLAGS
 #
 
+SET(SCALAPACK_DIR "" CACHE PATH "An optional hint to a SCALAPACK directory")
+SET(BLACS_DIR "" CACHE PATH "An optional hint to a BLACS directory")
 SET_IF_EMPTY(SCALAPACK_DIR "$ENV{SCALAPACK_DIR}")
 SET_IF_EMPTY(BLACS_DIR "$ENV{BLACS_DIR}")
 
@@ -68,9 +70,6 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(SCALAPACK DEFAULT_MSG
   )
 
 MARK_AS_ADVANCED(
-  lapack_LIBRARY
-  atlas_LIBRARY
-  blas_LIBRARY
   SCALAPACK_LIBRARY
   BLACS_LIBRARY
   BLACSCINIT_LIBRARY
@@ -84,17 +83,8 @@ IF(SCALAPACK_FOUND)
     ${BLACS_LIBRARIES}
     ${MPI_Fortran_LIBRARIES} # for good measure
     )
-  SET(SCALAPACK_LINKER_FLAGS
-    ${LAPACK_LINKER_FLAGS}
-    )
+  SET(SCALAPACK_LINKER_FLAGS ${LAPACK_LINKER_FLAGS})
 
   MARK_AS_ADVANCED(SCALAPACK_DIR BLACS_DIR)
-ELSE()
-  SET(SCALAPACK_DIR "" CACHE PATH
-    "An optional hint to a SCALAPACK directory"
-    )
-  SET(BLACS_DIR "" CACHE PATH
-    "An optional hint to a BLACS directory"
-    )
 ENDIF()
 
diff --git a/deal.II/cmake/modules/FindSLEPC.cmake b/deal.II/cmake/modules/FindSLEPC.cmake
index 9de3500f45..d65e6f41a1 100644
--- a/deal.II/cmake/modules/FindSLEPC.cmake
+++ b/deal.II/cmake/modules/FindSLEPC.cmake
@@ -31,6 +31,7 @@
 
 INCLUDE(FindPackageHandleStandardArgs)
 
+SET(SLEPC_DIR "" CACHE PATH "An optional hint to a SLEPC directory")
 SET_IF_EMPTY(SLEPC_DIR "$ENV{SLEPC_DIR}")
 SET_IF_EMPTY(PETSC_DIR "$ENV{PETSC_DIR}")
 SET_IF_EMPTY(PETSC_ARCH "$ENV{PETSC_ARCH}")
@@ -126,9 +127,5 @@ IF(SLEPC_FOUND)
     )
 
   MARK_AS_ADVANCED(SLEPC_DIR)
-ELSE()
-  SET(SLEPC_DIR "" CACHE PATH
-    "An optional hint to a SLEPC directory"
-    )
 ENDIF()
 
diff --git a/deal.II/cmake/modules/FindTBB.cmake b/deal.II/cmake/modules/FindTBB.cmake
index 82f407417e..354f968074 100644
--- a/deal.II/cmake/modules/FindTBB.cmake
+++ b/deal.II/cmake/modules/FindTBB.cmake
@@ -29,6 +29,7 @@
 
 INCLUDE(FindPackageHandleStandardArgs)
 
+SET(TBB_DIR "" CACHE PATH "An optional hint to a TBB installation")
 SET_IF_EMPTY(TBB_DIR "$ENV{TBB_DIR}")
 
 FIND_PATH(TBB_INCLUDE_DIR tbb/tbb_stddef.h
@@ -87,7 +88,6 @@ MARK_AS_ADVANCED(
   )
 
 IF(TBB_FOUND)
-
   IF(NOT TBB_DEBUG_LIBRARY MATCHES "-NOTFOUND")
     SET(TBB_WITH_DEBUGLIB TRUE)
     SET(TBB_LIBRARIES debug ${TBB_DEBUG_LIBRARY} optimized ${TBB_LIBRARY})
@@ -98,9 +98,5 @@ IF(TBB_FOUND)
   SET(TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR})
 
   MARK_AS_ADVANCED(TBB_DIR)
-ELSE()
-  SET(TBB_DIR "" CACHE PATH
-    "An optional hint to a TBB installation"
-    )
 ENDIF()
 
diff --git a/deal.II/cmake/modules/FindTRILINOS.cmake b/deal.II/cmake/modules/FindTRILINOS.cmake
index b6526cf4a3..edb94438d4 100644
--- a/deal.II/cmake/modules/FindTRILINOS.cmake
+++ b/deal.II/cmake/modules/FindTRILINOS.cmake
@@ -33,6 +33,7 @@
 
 INCLUDE(FindPackageHandleStandardArgs)
 
+SET(TRILINOS_DIR "" CACHE PATH "An optional hint to a Trilinos installation")
 SET_IF_EMPTY(TRILINOS_DIR "$ENV{TRILINOS_DIR}")
 
 #
@@ -213,9 +214,5 @@ ELSE()
   SET(TRILINOS_LIBRARIES)
   SET(TRILINOS_INCLUDE_DIRS)
   UNSET(TRILINOS_CONFIG_DIR_SAVED CACHE)
-
-  SET(TRILINOS_DIR "" CACHE PATH
-    "An optional hint to a Trilinos installation"
-    )
 ENDIF()
 
diff --git a/deal.II/cmake/modules/FindUMFPACK.cmake b/deal.II/cmake/modules/FindUMFPACK.cmake
index b4048cf40d..9db4548663 100644
--- a/deal.II/cmake/modules/FindUMFPACK.cmake
+++ b/deal.II/cmake/modules/FindUMFPACK.cmake
@@ -30,6 +30,10 @@
 
 INCLUDE(FindPackageHandleStandardArgs)
 
+SET(UMFPACK_DIR "" CACHE PATH "An optional hint to an UMFPACK directory")
+SET(SUITESPARSE_DIR "" CACHE PATH
+  "An optional hint to a SUITESPARSE directory"
+  )
 FOREACH(_comp SUITESPARSE SUITESPARSE_CONFIG UMFPACK AMD CHOLMOD COLAMD)
   SET_IF_EMPTY(${_comp}_DIR "$ENV{${_comp}_DIR}")
 ENDFOREACH()
@@ -206,16 +210,7 @@ IF(UMFPACK_FOUND)
     ${AMD_INCLUDE_DIR}
     ${SuiteSparse_config_INCLUDE_DIR}
     )
-  SET(UMFPACK_LINKER_FLAGS
-    ${LAPACK_LINKER_FLAGS}
-    )
+  SET(UMFPACK_LINKER_FLAGS ${LAPACK_LINKER_FLAGS})
 
   MARK_AS_ADVANCED(UMFPACK_DIR SUITESPARSE_DIR)
-ELSE()
-  SET(UMFPACK_DIR "" CACHE PATH
-    "An optional hint to an UMFPACK directory"
-    )
-  SET(SUITESPARSE_DIR "" CACHE PATH
-    "An optional hint to a SUITESPARSE directory"
-    )
 ENDIF()