From: maier Date: Thu, 28 Feb 2013 00:26:37 +0000 (+0000) Subject: Unify error messages X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54efe169eb574c6284ac0cfdd68f03725171a9cf;p=dealii-svn.git Unify error messages git-svn-id: https://svn.dealii.org/branches/branch_cmake@28629 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/cmake/configure/configure_hdf5.cmake b/deal.II/cmake/configure/configure_hdf5.cmake index 5895c6c3e7..68bc1d0360 100644 --- a/deal.II/cmake/configure/configure_hdf5.cmake +++ b/deal.II/cmake/configure/configure_hdf5.cmake @@ -13,19 +13,7 @@ ##### # -# Configuration for the netcdf library: +# Configuration for the hdf5 library: # -MACRO(FEATURE_HDF5_ERROR_MESSAGE) - MESSAGE(FATAL_ERROR "\n" - "Could not find the hdf5 library!\n" - "Please ensure that the hdf5 library is installed on your computer.\n" - "If the library is not at a default location, either provide some hints\n" - "for the autodetection:\n" - " $ HDF5_DIR=\"...\" cmake <...>\n" - " $ cmake -DHDF5_DIR=\"...\" <...>\n" - "or set the relevant variables by hand in ccmake.\n\n" - ) -ENDMACRO() - CONFIGURE_FEATURE(HDF5) diff --git a/deal.II/cmake/configure/configure_metis.cmake b/deal.II/cmake/configure/configure_metis.cmake index 856fd48a75..332d61dcb2 100644 --- a/deal.II/cmake/configure/configure_metis.cmake +++ b/deal.II/cmake/configure/configure_metis.cmake @@ -16,7 +16,6 @@ # Configuration for the netcdf library: # - MACRO(FEATURE_METIS_FIND_EXTERNAL var) FIND_PACKAGE(METIS) @@ -32,22 +31,11 @@ MACRO(FEATURE_METIS_FIND_EXTERNAL var) UNSET(METIS_INCLUDE_DIR CACHE) UNSET(METIS_DIR CACHE) UNSET(METIS_FOUND CACHE) + SET(METIS_DIR "" CACHE STRING + "An optional hint to a metis directory" + ) ENDIF() ENDIF() ENDMACRO() - -MACRO(FEATURE_METIS_ERROR_MESSAGE) - MESSAGE(FATAL_ERROR "\n" - "Could not find the metis library!\n" - "Please ensure that the metis library version 5.0 or newer is installed on your computer.\n" - "If the library is not at a default location, either provide some hints\n" - "for the autodetection:\n" - " $ METIS_DIR=\"...\" cmake <...>\n" - " $ cmake -DMETIS_DIR=\"...\" <...>\n" - "or set the relevant variables by hand in ccmake.\n\n" - ) -ENDMACRO() - - CONFIGURE_FEATURE(METIS) diff --git a/deal.II/cmake/configure/configure_mumps.cmake b/deal.II/cmake/configure/configure_mumps.cmake index 2401ca0ac3..7f08a07ea5 100644 --- a/deal.II/cmake/configure/configure_mumps.cmake +++ b/deal.II/cmake/configure/configure_mumps.cmake @@ -18,19 +18,4 @@ SET(FEATURE_MUMPS_DEPENDS DEAL_II_WITH_MPI) - -MACRO(FEATURE_MUMPS_ERROR_MESSAGE) - MESSAGE(FATAL_ERROR "\n" - "Could not find the mumps library!\n" - "Please ensure that the library is installed on your computer.\n" - "If the libraries is not at a default location, either provide some hints\n" - "for the autodetection:\n" - " $ MUMPS_DIR=\"...\" cmake <...>\n" - " $ cmake -DMUMPS_DIR=\"...\" <...>\n" - "or set the relevant variables by hand in ccmake.\n" - "Relevant hints for MUMPS are MUMPS_DIR, SCALAPACK_DIR (and BLACS_DIR).\n\n" - ) -ENDMACRO() - - CONFIGURE_FEATURE(MUMPS) diff --git a/deal.II/cmake/configure/configure_p4est.cmake b/deal.II/cmake/configure/configure_p4est.cmake index 5da63d9259..49e595e38d 100644 --- a/deal.II/cmake/configure/configure_p4est.cmake +++ b/deal.II/cmake/configure/configure_p4est.cmake @@ -16,10 +16,8 @@ # Configuration for the p4est and sc libraries: # - SET(FEATURE_P4EST_DEPENDS DEAL_II_WITH_MPI) - MACRO(FEATURE_P4EST_FIND_EXTERNAL var) FIND_PACKAGE(P4EST) @@ -38,18 +36,4 @@ MACRO(FEATURE_P4EST_FIND_EXTERNAL var) ENDIF() ENDMACRO() - -MACRO(FEATURE_P4EST_ERROR_MESSAGE) - MESSAGE(FATAL_ERROR "\n" - "Could not find the p4est and sc libraries!\n" - "Please ensure that the libraries are installed on your computer.\n" - "If the libraries are not at a default location, either provide some hints\n" - "for the autodetection:\n" - " $ P4EST_DIR=\"...\" cmake <...>\n" - " $ cmake -DP4EST_DIR=\"...\" <...>\n" - "or set the relevant variables by hand in ccmake.\n" - ) -ENDMACRO() - - CONFIGURE_FEATURE(P4EST) diff --git a/deal.II/cmake/configure/configure_slepc.cmake b/deal.II/cmake/configure/configure_slepc.cmake index a98af1590a..b431cce9bf 100644 --- a/deal.II/cmake/configure/configure_slepc.cmake +++ b/deal.II/cmake/configure/configure_slepc.cmake @@ -16,10 +16,8 @@ # Configuration for the SLEPC library: # - SET(FEATURE_SLEPC_DEPENDS DEAL_II_WITH_PETSC) - MACRO(FEATURE_SLEPC_FIND_EXTERNAL var) FIND_PACKAGE(SLEPC) @@ -43,7 +41,6 @@ MACRO(FEATURE_SLEPC_FIND_EXTERNAL var) SET(${var} FALSE) ENDIF() ENDIF() - ENDMACRO() @@ -53,9 +50,7 @@ MACRO(FEATURE_SLEPC_CONFIGURE_EXTERNAL) # The user has to know the location of the SLEPC headers as well: LIST(APPEND DEAL_II_USER_INCLUDE_DIRS ${SLEPC_INCLUDE_DIRS}) - LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES - ${SLEPC_LIBRARIES} - ) + LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${SLEPC_LIBRARIES}) ENDMACRO() diff --git a/deal.II/cmake/configure/configure_umfpack.cmake b/deal.II/cmake/configure/configure_umfpack.cmake index 2865357f95..f3de32386e 100644 --- a/deal.II/cmake/configure/configure_umfpack.cmake +++ b/deal.II/cmake/configure/configure_umfpack.cmake @@ -22,7 +22,6 @@ # SET(FEATURE_UMFPACK_DEPENDS DEAL_II_WITH_LAPACK) - MACRO(FEATURE_UMFPACK_CONFIGURE_BUNDLED) INCLUDE_DIRECTORIES( ${UMFPACK_FOLDER}/UMFPACK/Include @@ -30,10 +29,9 @@ MACRO(FEATURE_UMFPACK_CONFIGURE_BUNDLED) ) ENDMACRO() - MACRO(FEATURE_UMFPACK_ERROR_MESSAGE) MESSAGE(FATAL_ERROR "\n" - "Could not find the umfpack and amd libraries!\n" + "Could not find umfpack and supporting libraries!\n" "Please ensure that the libraries are installed on your computer.\n" "If the libraries are not at a default location, either provide some hints\n" "for the autodetection:\n" @@ -48,5 +46,4 @@ MACRO(FEATURE_UMFPACK_ERROR_MESSAGE) ) ENDMACRO() - CONFIGURE_FEATURE(UMFPACK) diff --git a/deal.II/cmake/macros/macro_configure_feature.cmake b/deal.II/cmake/macros/macro_configure_feature.cmake index f80a79994d..2ac5611973 100644 --- a/deal.II/cmake/macros/macro_configure_feature.cmake +++ b/deal.II/cmake/macros/macro_configure_feature.cmake @@ -91,24 +91,34 @@ ENDMACRO() # MACRO(FEATURE_ERROR_MESSAGE _feature) STRING(TOLOWER ${_feature} _feature_lowercase) - IF(FEATURE_${_feature}_HAVE_BUNDLED) - MESSAGE(FATAL_ERROR "\n" - "Could not find the ${_feature_lowercase} library!\n\n" - "Please ensure that the ${_feature_lowercase} library is installed on your computer.\n" - "If the library is not at a default location, either provide some hints\n" - "for the autodetection, or set the relevant variables by hand in ccmake.\n\n" - "Alternatively you may choose to compile the bundled library of\n" - "${_feature_lowercase} by setting DEAL_II_ALLOW_BUNDLED=on or\n" - "DEAL_II_FORCE_BUNDLED_${_feature}=on.\n\n" + + IF(DEFINED ${_feature}_DIR) + SET(_hint_snippet " + $ ${_feature}_DIR=\"...\" cmake <...> + $ cmake -D${_feature}_DIR=\"...\" <...> +or set the relevant variables by hand in ccmake." ) - ELSE() - MESSAGE(FATAL_ERROR "\n" - "Could not find the ${_feature_lowercase} library!\n\n" - "Please ensure that the ${_feature_lowercase} library is installed on your computer.\n" - "If the library is not at a default location, either provide some hints\n" - "for the autodetection, or set the relevant variables by hand in ccmake.\n\n" + ELSE() + SET(_hint_snippet + "or set the relevant variables by hand in ccmake." ) ENDIF() + + IF(FEATURE_${_feature}_HAVE_BUNDLED) + SET(_bundled_snippet + "\n\nAlternatively you may choose to compile the bundled library of +${_feature_lowercase} by setting DEAL_II_ALLOW_BUNDLED=on or\nDEAL_II_FORCE_BUNDLED_${_feature}=on.\n" + ) + ELSE() + SET(_bundled_snippet "\n") + ENDIF() + + MESSAGE(FATAL_ERROR "\n" + "Could not find the ${_feature_lowercase} library!\n" + "Please ensure that the ${_feature_lowercase} library is installed on your computer.\n" + "If the library is not at a default location, either provide some hints\n" + "for autodetection,${_hint_snippet}${_bundled_snippet}" + ) ENDMACRO()