From: maier Date: Fri, 21 Sep 2012 10:21:30 +0000 (+0000) Subject: Bugfix in configure_trilinos.cmake X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b00f65b0ced9b57f3df00f260ba5e4821c9cfcd;p=dealii-svn.git Bugfix in configure_trilinos.cmake git-svn-id: https://svn.dealii.org/branches/branch_cmake@26587 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/CMakeLists.txt b/deal.II/CMakeLists.txt index 714a682084..7e472f695c 100644 --- a/deal.II/CMakeLists.txt +++ b/deal.II/CMakeLists.txt @@ -283,7 +283,7 @@ INCLUDE(setup_deal_ii) INCLUDE(setup_compiler_flags) -########################################################################### +########################################################################## # # FAT NOTE: # @@ -291,6 +291,7 @@ INCLUDE(setup_compiler_flags) # altered in the platform checks and features configuration # (beside setting a lot of DEAL_II_* definitions...): # +# # For internal use: # # CMAKE_SHARED_LINKER_FLAGS @@ -300,6 +301,10 @@ INCLUDE(setup_compiler_flags) # for setting necessary compiler flags, e.g. -std=c++11 (if # available). # +# INCLUDE_DIRECTORIES() +# For setting necessary include dirs for the compilation of the +# deal.II library. +# ADD_CUSTOM_TARGET(deal_ii_target_dependencies) # Used as a dummy target for all the stuff that has to be done # before the library can be compiled. @@ -308,8 +313,8 @@ ADD_CUSTOM_TARGET(deal_ii_target_dependencies) # For internal and external use: # SET( DEAL_II_EXTERNAL_LIBRARIES) -# Used to keep track of external libraries, the deal.II library and -# user programs have to be linked against. +# Used to keep track of external libraries, the deal.II library +# and user programs have to be linked against. # # # For external use: @@ -318,7 +323,7 @@ SET( DEAL_II_EXTERNAL_LIBRARIES) # Used to keep track of external include dirs, necessary for the # compilation of user programs. # -########################################################################### +########################################################################## # diff --git a/deal.II/cmake-TODO b/deal.II/cmake-TODO index b83451d2b2..c490306c82 100644 --- a/deal.II/cmake-TODO +++ b/deal.II/cmake-TODO @@ -2,6 +2,9 @@ TODO: * Implement cmake packaging +* The Find modules under contrib/cmake/modules export <...>_LIBRARY and + <...>_INCLUDE_DIR, wheras the convention is nowadays _LIBRARIES and + _INCLUDE_DIRS, fix this. * Make Make.global_options work... diff --git a/deal.II/contrib/cmake/configure/configure_1_mpi.cmake b/deal.II/contrib/cmake/configure/configure_1_mpi.cmake index 2ec0c64d68..d2cc849ba5 100644 --- a/deal.II/contrib/cmake/configure/configure_1_mpi.cmake +++ b/deal.II/contrib/cmake/configure/configure_1_mpi.cmake @@ -13,20 +13,25 @@ ENDMACRO() MACRO(FEATURE_MPI_CONFIGURE_EXTERNAL var) - INCLUDE_DIRECTORIES(${MPI_CXX_INCLUDE_PATH}) ADD_FLAGS(CMAKE_CXX_FLAGS "${MPI_CXX_COMPILE_FLAGS}") ADD_FLAGS(CMAKE_SHARED_LINKER_FLAGS "${MPI_CXX_LINK_FLAGS}") + LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${MPI_CXX_LIBRARIES}) + INCLUDE_DIRECTORIES(${MPI_CXX_INCLUDE_PATH}) - SET(DEAL_II_COMPILER_SUPPORTS_MPI TRUE) + # The user has to know the location of the mpi headers as well: + LIST(APPEND DEAL_II_EXTERNAL_INCLUDE_DIRS ${MPI_CXX_INCLUDE_PATH}) + + # TODO: Set up the rest: - # TODO: (Maybe) set up the rest: #MPI_CXX_COMPILER MPI Compiler wrapper for CXX #MPIEXEC Executable for running MPI programs #MPIEXEC_NUMPROC_FLAG Flag to pass to MPIEXEC before giving it the number of processors to run on #MPIEXEC_PREFLAGS Flags to pass to MPIEXEC directly before the executable to run. #MPIEXEC_POSTFLAGS Flags to pass to MPIEXEC after other flags + SET(DEAL_II_COMPILER_SUPPORTS_MPI TRUE) + SET(${var} TRUE) ENDMACRO() diff --git a/deal.II/contrib/cmake/configure/configure_trilinos.cmake b/deal.II/contrib/cmake/configure/configure_trilinos.cmake index bd710f492b..02db58dd75 100644 --- a/deal.II/contrib/cmake/configure/configure_trilinos.cmake +++ b/deal.II/contrib/cmake/configure/configure_trilinos.cmake @@ -83,7 +83,7 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var) # configured with mpi. We use this as a check for the mpi configuration # of Epetra. # - IF(EXISTS "${TRILINOS_INCLUDE_DIR}/Epetra_MpiComm.h") + IF(EXISTS "${TRILINOS_INCLUDE_DIRS}/Epetra_MpiComm.h") SET(TRILINOS_WITH_MPI TRUE) ENDIF() @@ -102,7 +102,7 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var) # with the -std=c++0x flag of GCC, see deal.II FAQ. # Test whether that is indeed the case # - LIST(APPEND CMAKE_REQUIRED_INCLUDES ${TRILINOS_INCLUDE_DIR}) + LIST(APPEND CMAKE_REQUIRED_INCLUDES ${TRILINOS_INCLUDE_DIRS}) ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-std=c++0x") CHECK_CXX_SOURCE_COMPILES( " @@ -135,14 +135,18 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var) ENDIF() ENDIF() STRIP_FLAG(CMAKE_REQUIRED_FLAGS "-std=c++0x") - LIST(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES ${TRILINOS_INCLUDE_DIR}) + LIST(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES ${TRILINOS_INCLUDE_DIRS}) ENDIF(TRILINOS_FOUND) ENDMACRO() MACRO(FEATURE_TRILINOS_CONFIGURE_EXTERNAL var) - INCLUDE_DIRECTORIES(${TRILINOS_INCLUDE_DIR}) + INCLUDE_DIRECTORIES(${TRILINOS_INCLUDE_DIRS}) + + # The user has to know the location of the trilinos headers as well: + LIST(APPEND DEAL_II_EXTERNAL_INCLUDE_DIRS ${TRILINOS_INCLUDE_DIRS}) + LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${TRILINOS_LIBRARIES} diff --git a/deal.II/contrib/cmake/modules/FindTRILINOS.cmake b/deal.II/contrib/cmake/modules/FindTRILINOS.cmake index 78b6895dd8..08adb21346 100644 --- a/deal.II/contrib/cmake/modules/FindTRILINOS.cmake +++ b/deal.II/contrib/cmake/modules/FindTRILINOS.cmake @@ -30,9 +30,7 @@ STRING(REGEX REPLACE TRILINOS_SUBMINOR "${Trilinos_VERSION}") -FIND_PATH(TRILINOS_INCLUDE_DIR Trilinos_version.h - HINTS ${Trilinos_INCLUDE_DIRS} - ) +SET(TRILINOS_INCLUDE_DIRS ${Trilinos_INCLUDE_DIRS}) # # We'd like to have the full library names but the Trilinos package only @@ -52,14 +50,14 @@ ENDFOREACH() FIND_PACKAGE_HANDLE_STANDARD_ARGS(TRILINOS DEFAULT_MSG TRILINOS_DIR - TRILINOS_INCLUDE_DIR + TRILINOS_INCLUDE_DIRS TRILINOS_LIBRARIES ) IF(TRILINOS_FOUND) MARK_AS_ADVANCED( TRILINOS_DIR - TRILINOS_INCLUDE_DIR + TRILINOS_INCLUDE_DIRS TRILINOS_LIBRARIES ) ENDIF()