From: Matthias Maier Date: Wed, 28 May 2014 14:23:05 +0000 (+0000) Subject: CMake: Bugfix, do not override internal CMake calls X-Git-Tag: v8.2.0-rc1~447 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c83f872a57bbf5dec377d8752e6cab6b8a4cc05e;p=dealii.git CMake: Bugfix, do not override internal CMake calls I turns out that overriding FIND_PACKAGE and calling into _FIND_PACKAGE is not really stable git-svn-id: https://svn.dealii.org/trunk@32982 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/cmake/configure/configure_1_lapack.cmake b/deal.II/cmake/configure/configure_1_lapack.cmake index f8c3ff1a21..ca26b4c2ef 100644 --- a/deal.II/cmake/configure/configure_1_lapack.cmake +++ b/deal.II/cmake/configure/configure_1_lapack.cmake @@ -19,7 +19,7 @@ # MACRO(FEATURE_LAPACK_FIND_EXTERNAL var) - FIND_PACKAGE(LAPACK) + DEAL_II_FIND_PACKAGE(LAPACK) # # We do a check for availability of every single LAPACK function we use. diff --git a/deal.II/cmake/configure/configure_1_threads.cmake b/deal.II/cmake/configure/configure_1_threads.cmake index f07f29725d..d91be04339 100644 --- a/deal.II/cmake/configure/configure_1_threads.cmake +++ b/deal.II/cmake/configure/configure_1_threads.cmake @@ -34,7 +34,7 @@ MACRO(SETUP_THREADING) CLEAR_CMAKE_REQUIRED() SWITCH_LIBRARY_PREFERENCE() - FIND_PACKAGE(Threads) + DEAL_II_FIND_PACKAGE(Threads) SWITCH_LIBRARY_PREFERENCE() RESET_CMAKE_REQUIRED() @@ -134,7 +134,7 @@ ENDMACRO() # MACRO(FEATURE_THREADS_FIND_EXTERNAL var) - FIND_PACKAGE(TBB) + DEAL_II_FIND_PACKAGE(TBB) IF(TBB_FOUND) SET(${var} TRUE) diff --git a/deal.II/cmake/configure/configure_2_metis.cmake b/deal.II/cmake/configure/configure_2_metis.cmake index 4d499c0d60..247560d5e5 100644 --- a/deal.II/cmake/configure/configure_2_metis.cmake +++ b/deal.II/cmake/configure/configure_2_metis.cmake @@ -21,7 +21,7 @@ SET(FEATURE_METIS_AFTER MPI) # MACRO(FEATURE_METIS_FIND_EXTERNAL var) - FIND_PACKAGE(METIS) + DEAL_II_FIND_PACKAGE(METIS) IF(METIS_FOUND) SET(${var} TRUE) diff --git a/deal.II/cmake/configure/configure_2_trilinos.cmake b/deal.II/cmake/configure/configure_2_trilinos.cmake index a79505384b..e7366f0940 100644 --- a/deal.II/cmake/configure/configure_2_trilinos.cmake +++ b/deal.II/cmake/configure/configure_2_trilinos.cmake @@ -20,7 +20,7 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var) - FIND_PACKAGE(TRILINOS) + DEAL_II_FIND_PACKAGE(TRILINOS) IF(TRILINOS_FOUND) # diff --git a/deal.II/cmake/configure/configure_3_petsc.cmake b/deal.II/cmake/configure/configure_3_petsc.cmake index 662c30f8a3..0099a0e27d 100644 --- a/deal.II/cmake/configure/configure_3_petsc.cmake +++ b/deal.II/cmake/configure/configure_3_petsc.cmake @@ -22,7 +22,7 @@ SET(FEATURE_PETSC_AFTER MPI) MACRO(FEATURE_PETSC_FIND_EXTERNAL var) - FIND_PACKAGE(PETSC) + DEAL_II_FIND_PACKAGE(PETSC) IF(PETSC_FOUND) # diff --git a/deal.II/cmake/configure/configure_hdf5.cmake b/deal.II/cmake/configure/configure_hdf5.cmake index 6a335a232c..57c653410f 100644 --- a/deal.II/cmake/configure/configure_hdf5.cmake +++ b/deal.II/cmake/configure/configure_hdf5.cmake @@ -22,7 +22,7 @@ SET(FEATURE_HDF5_AFTER MPI) MACRO(FEATURE_HDF5_FIND_EXTERNAL var) - FIND_PACKAGE(HDF5) + DEAL_II_FIND_PACKAGE(HDF5) IF(HDF5_FOUND) SET(${var} TRUE) diff --git a/deal.II/cmake/configure/configure_mumps.cmake b/deal.II/cmake/configure/configure_mumps.cmake index ce1d2652b1..39b9a2037c 100644 --- a/deal.II/cmake/configure/configure_mumps.cmake +++ b/deal.II/cmake/configure/configure_mumps.cmake @@ -22,7 +22,7 @@ SET(FEATURE_MUMPS_DEPENDS MPI LAPACK) MACRO(FEATURE_MUMPS_FIND_EXTERNAL var) - FIND_PACKAGE(MUMPS) + DEAL_II_FIND_PACKAGE(MUMPS) IF(MUMPS_FOUND) SET(${var} TRUE) diff --git a/deal.II/cmake/configure/configure_p4est.cmake b/deal.II/cmake/configure/configure_p4est.cmake index 25acd30d86..3208c4a184 100644 --- a/deal.II/cmake/configure/configure_p4est.cmake +++ b/deal.II/cmake/configure/configure_p4est.cmake @@ -22,7 +22,7 @@ SET(FEATURE_P4EST_DEPENDS MPI) MACRO(FEATURE_P4EST_FIND_EXTERNAL var) - FIND_PACKAGE(P4EST) + DEAL_II_FIND_PACKAGE(P4EST) IF(P4EST_FOUND) SET(${var} TRUE) diff --git a/deal.II/cmake/configure/configure_slepc.cmake b/deal.II/cmake/configure/configure_slepc.cmake index c300f7ea7b..a2489ccfcb 100644 --- a/deal.II/cmake/configure/configure_slepc.cmake +++ b/deal.II/cmake/configure/configure_slepc.cmake @@ -22,7 +22,7 @@ SET(FEATURE_SLEPC_DEPENDS PETSC) MACRO(FEATURE_SLEPC_FIND_EXTERNAL var) - FIND_PACKAGE(SLEPC) + DEAL_II_FIND_PACKAGE(SLEPC) IF(SLEPC_FOUND) # diff --git a/deal.II/cmake/macros/macro_configure_feature.cmake b/deal.II/cmake/macros/macro_configure_feature.cmake index 2c1277d6ae..4be1806ce8 100644 --- a/deal.II/cmake/macros/macro_configure_feature.cmake +++ b/deal.II/cmake/macros/macro_configure_feature.cmake @@ -133,7 +133,7 @@ ENDMACRO() # Default macro for finding an external library: # MACRO(FEATURE_FIND_EXTERNAL _feature _var) - FIND_PACKAGE(${_feature}) + DEAL_II_FIND_PACKAGE(${_feature}) IF(${_feature}_FOUND) SET(${_var} TRUE) ENDIF() diff --git a/deal.II/cmake/macros/macro_find_package.cmake b/deal.II/cmake/macros/macro_deal_ii_find_package.cmake similarity index 88% rename from deal.II/cmake/macros/macro_find_package.cmake rename to deal.II/cmake/macros/macro_deal_ii_find_package.cmake index c7e65fbe85..70f52d6c9a 100644 --- a/deal.II/cmake/macros/macro_find_package.cmake +++ b/deal.II/cmake/macros/macro_deal_ii_find_package.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2013 by the deal.II authors +## Copyright (C) 2013 - 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -20,12 +20,12 @@ # ${package}_FOUND and ${package}_LIBRARIES to allow easy custom overrides # -MACRO(FIND_PACKAGE _package_name) +MACRO(DEAL_II_FIND_PACKAGE _package_name) STRING(TOUPPER ${_package_name} _package_name_uppercase) IF( NOT DEFINED ${_package_name_uppercase}_FOUND AND NOT DEFINED ${_package_name_uppercase}_LIBRARIES ) - _FIND_PACKAGE (${_package_name} ${ARGN}) + FIND_PACKAGE (${_package_name} ${ARGN}) ELSE() IF(NOT DEFINED ${_package_name_uppercase}_FOUND) SET(${_package_name_uppercase}_FOUND TRUE) diff --git a/deal.II/cmake/modules/FindBOOST.cmake b/deal.II/cmake/modules/FindBOOST.cmake index b14b063f7c..7fce37b311 100644 --- a/deal.II/cmake/modules/FindBOOST.cmake +++ b/deal.II/cmake/modules/FindBOOST.cmake @@ -42,14 +42,14 @@ IF(NOT BUILD_SHARED_LIBS) SET(Boost_USE_STATIC_LIBS TRUE) ENDIF() -FIND_PACKAGE(Boost 1.44 COMPONENTS iostreams serialization system thread) +DEAL_II_FIND_PACKAGE(Boost 1.44 COMPONENTS iostreams serialization system thread) # # Fall back to dynamic libraries if no static libraries could be found: # IF(NOT Boost_FOUND AND Boost_USE_STATIC_LIBS) SET(Boost_USE_STATIC_LIBS FALSE) - FIND_PACKAGE(Boost 1.44 COMPONENTS iostreams serialization system thread) + DEAL_II_FIND_PACKAGE(Boost 1.44 COMPONENTS iostreams serialization system thread) ENDIF() IF(Boost_FOUND) diff --git a/deal.II/cmake/modules/FindBZIP2.cmake b/deal.II/cmake/modules/FindBZIP2.cmake index e6f7cbded2..eebd11b1ea 100644 --- a/deal.II/cmake/modules/FindBZIP2.cmake +++ b/deal.II/cmake/modules/FindBZIP2.cmake @@ -31,7 +31,7 @@ # LIST(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) -FIND_PACKAGE(BZip2) +DEAL_II_FIND_PACKAGE(BZip2) LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) SET(BZIP2_VERSION ${BZIP2_VERSION_STRING}) diff --git a/deal.II/cmake/modules/FindLAPACK.cmake b/deal.II/cmake/modules/FindLAPACK.cmake index 20b996f377..39834d4157 100644 --- a/deal.II/cmake/modules/FindLAPACK.cmake +++ b/deal.II/cmake/modules/FindLAPACK.cmake @@ -41,10 +41,10 @@ SET(_cmake_prefix_path_backup "${CMAKE_PREFIX_PATH}") LIST(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) SET(CMAKE_PREFIX_PATH ${BLAS_DIR} ${LAPACK_DIR} ${_cmake_prefix_path_backup}) -FIND_PACKAGE(BLAS) +DEAL_II_FIND_PACKAGE(BLAS) SET(CMAKE_PREFIX_PATH ${LAPACK_DIR} ${_cmake_prefix_path_backup}) -FIND_PACKAGE(LAPACK) +DEAL_II_FIND_PACKAGE(LAPACK) SET(CMAKE_PREFIX_PATH ${_cmake_prefix_path_backup}) LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) diff --git a/deal.II/cmake/modules/FindMPI.cmake b/deal.II/cmake/modules/FindMPI.cmake index 111c75a58e..352889eeb9 100644 --- a/deal.II/cmake/modules/FindMPI.cmake +++ b/deal.II/cmake/modules/FindMPI.cmake @@ -64,7 +64,7 @@ ENDIF() # Call the system FindMPI.cmake module: # LIST(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) -FIND_PACKAGE(MPI) +DEAL_II_FIND_PACKAGE(MPI) IF(NOT MPI_CXX_FOUND AND DEAL_II_WITH_MPI) # @@ -76,12 +76,12 @@ IF(NOT MPI_CXX_FOUND AND DEAL_II_WITH_MPI) "MPI not found but DEAL_II_WITH_MPI is set to TRUE." " Try again with more aggressive search paths:" ) - # Clear variables so that FIND_PACKAGE runs again: + # Clear variables so that DEAL_II_FIND_PACKAGE runs again: SET(MPI_FOUND) UNSET(MPI_CXX_COMPILER CACHE) UNSET(MPI_C_COMPILER CACHE) UNSET(MPI_Fortran_COMPILER CACHE) - FIND_PACKAGE(MPI) + DEAL_II_FIND_PACKAGE(MPI) ENDIF() LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) diff --git a/deal.II/cmake/modules/FindTRILINOS.cmake b/deal.II/cmake/modules/FindTRILINOS.cmake index 6fc8c408d4..4fb97c618f 100644 --- a/deal.II/cmake/modules/FindTRILINOS.cmake +++ b/deal.II/cmake/modules/FindTRILINOS.cmake @@ -37,7 +37,7 @@ SET_IF_EMPTY(TRILINOS_DIR "$ENV{TRILINOS_DIR}") # # Include the trilinos package configuration: # -FIND_PACKAGE(TRILINOS_CONFIG +DEAL_II_FIND_PACKAGE(TRILINOS_CONFIG CONFIG QUIET NAMES Trilinos TRILINOS HINTS diff --git a/deal.II/cmake/modules/FindZLIB.cmake b/deal.II/cmake/modules/FindZLIB.cmake index a3ecfe357d..3378409601 100644 --- a/deal.II/cmake/modules/FindZLIB.cmake +++ b/deal.II/cmake/modules/FindZLIB.cmake @@ -37,7 +37,7 @@ IF(NOT "${ZLIB_DIR}" STREQUAL "") SET(ZLIB_ROOT ${ZLIB_DIR}) ENDIF() LIST(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) -FIND_PACKAGE(ZLIB) +DEAL_II_FIND_PACKAGE(ZLIB) LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) SET(ZLIB_VERSION ${ZLIB_VERSION_STRING}) diff --git a/deal.II/doc/developers/cmake-internals.html b/deal.II/doc/developers/cmake-internals.html index dad7505cfb..877c71dd94 100644 --- a/deal.II/doc/developers/cmake-internals.html +++ b/deal.II/doc/developers/cmake-internals.html @@ -461,7 +461,7 @@ FEATURE_<FEATURE>_FIND_EXTERNAL(var) (a macro) fulfilled. In this case all necessary variables for FEATURE_<FEATURE>_CONFIGURE_EXTERNAL must be set. Otherwise var should remain unset. - If this macro is undefined, FIND_PACKAGE(<FEATURES>) is + If this macro is undefined, DEAL_II_FIND_PACKAGE(<FEATURES>) is called directly instead. FEATURE_<FEATURE>_CONFIGURE_EXTERNAL() (a macro)