From 0c0742636ce2e0290d15dae05efef63b0be59484 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Sat, 1 Feb 2014 21:53:24 +0000 Subject: [PATCH] CMake: Break everything (tm). - Redesign complete feature configuration process git-svn-id: https://svn.dealii.org/trunk@32368 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/bundled/CMakeLists.txt | 8 -- .../checks/check_02_system_features.cmake | 2 +- deal.II/cmake/config/CMakeLists.txt | 13 +- .../cmake/configure/configure_1_bzip2.cmake | 3 +- .../cmake/configure/configure_1_lapack.cmake | 3 +- deal.II/cmake/configure/configure_1_mpi.cmake | 25 ++-- .../cmake/configure/configure_1_threads.cmake | 42 +++--- .../cmake/configure/configure_2_metis.cmake | 2 +- .../configure/configure_2_trilinos.cmake | 15 +-- .../cmake/configure/configure_2_umfpack.cmake | 4 +- .../cmake/configure/configure_3_petsc.cmake | 8 +- deal.II/cmake/configure/configure_boost.cmake | 15 +-- .../configure/configure_functionparser.cmake | 4 +- deal.II/cmake/configure/configure_hdf5.cmake | 10 +- deal.II/cmake/configure/configure_mumps.cmake | 9 +- deal.II/cmake/configure/configure_p4est.cmake | 9 +- deal.II/cmake/configure/configure_slepc.cmake | 13 +- .../macros/macro_configure_feature.cmake | 6 +- .../macros/macro_deal_ii_add_library.cmake | 2 +- .../cmake/macros/macro_register_feature.cmake | 64 +++++---- deal.II/cmake/setup_finalize.cmake | 47 +++++-- deal.II/cmake/setup_write_config.cmake | 125 +++++++++++------- deal.II/doc/developers/cmake-internals.html | 100 ++++++++------ deal.II/doc/news/changes.h | 7 + deal.II/source/CMakeLists.txt | 12 +- 25 files changed, 296 insertions(+), 252 deletions(-) diff --git a/deal.II/bundled/CMakeLists.txt b/deal.II/bundled/CMakeLists.txt index b4ff8c8bf6..68855752cc 100644 --- a/deal.II/bundled/CMakeLists.txt +++ b/deal.II/bundled/CMakeLists.txt @@ -28,10 +28,6 @@ IF(FEATURE_BOOST_BUNDLED_CONFIGURED) PATTERN ".svn" EXCLUDE ) - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_source_includes - "${BOOST_FOLDER}/include\n" - ) - ADD_SUBDIRECTORY(${BOOST_FOLDER}/libs/serialization/src) IF(DEAL_II_WITH_ZLIB) @@ -59,10 +55,6 @@ IF(FEATURE_THREADS_BUNDLED_CONFIGURED) PATTERN ".svn" EXCLUDE ) - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_source_includes - "${TBB_FOLDER}/include\n" - ) - ADD_SUBDIRECTORY(${TBB_FOLDER}/src) ENDIF() diff --git a/deal.II/cmake/checks/check_02_system_features.cmake b/deal.II/cmake/checks/check_02_system_features.cmake index 20c158c636..df8616c2cc 100644 --- a/deal.II/cmake/checks/check_02_system_features.cmake +++ b/deal.II/cmake/checks/check_02_system_features.cmake @@ -72,7 +72,7 @@ IF(NOT m_LIBRARY MATCHES "-NOTFOUND") CHECK_CXX_SYMBOL_EXISTS("jn" "math.h" HAVE_JN) RESET_CMAKE_REQUIRED() IF(HAVE_JN) - LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${m_LIBRARY}) + LIST(APPEND DEAL_II_LIBRARIES ${m_LIBRARY}) ENDIF() ENDIF() diff --git a/deal.II/cmake/config/CMakeLists.txt b/deal.II/cmake/config/CMakeLists.txt index 4ade81d2b2..1789a4044d 100644 --- a/deal.II/cmake/config/CMakeLists.txt +++ b/deal.II/cmake/config/CMakeLists.txt @@ -28,15 +28,6 @@ MESSAGE(STATUS "Setting up project configuration") -# -# Read in auxiliary include directories for the build directory -# configuration: -# -FILE(STRINGS - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_source_includes - deal_ii_source_includes - ) - # # Configure the template-arguments file # @@ -140,7 +131,7 @@ SET(CONFIG_INCLUDE_DIRS \${DEAL_II_PATH}/include/deal.II ${CMAKE_SOURCE_DIR}/include/ ${CMAKE_SOURCE_DIR}/include/deal.II - ${deal_ii_source_includes} + ${DEAL_II_BUNDLED_INCLUDE_DIRS} ${DEAL_II_USER_INCLUDE_DIRS} ) CONFIGURE_FILE( @@ -351,7 +342,7 @@ IF(DEAL_II_COMPONENT_COMPAT_FILES) $(D)/install/deal.II ${CMAKE_SOURCE_DIR}/include/ ${CMAKE_SOURCE_DIR}/include/deal.II - ${deal_ii_source_includes} + ${DEAL_II_BUNDLED_INCLUDE_DIRS} ${DEAL_II_USER_INCLUDE_DIRS} ) CONFIGURE_FILE( diff --git a/deal.II/cmake/configure/configure_1_bzip2.cmake b/deal.II/cmake/configure/configure_1_bzip2.cmake index 61fd319e7e..a905aad144 100644 --- a/deal.II/cmake/configure/configure_1_bzip2.cmake +++ b/deal.II/cmake/configure/configure_1_bzip2.cmake @@ -19,12 +19,11 @@ # MACRO(FEATURE_BZIP2_FIND_EXTERNAL var) - FIND_PACKAGE(BZip2) IF(BZIP2_FOUND) # - # Rename some variables: + # Rename variables: # SET(BZIP2_VERSION ${BZIP2_VERSION_STRING}) SET(BZIP2_INCLUDE_DIRS ${BZIP2_INCLUDE_DIR}) diff --git a/deal.II/cmake/configure/configure_1_lapack.cmake b/deal.II/cmake/configure/configure_1_lapack.cmake index ede31c24ba..258af871f2 100644 --- a/deal.II/cmake/configure/configure_1_lapack.cmake +++ b/deal.II/cmake/configure/configure_1_lapack.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -80,7 +80,6 @@ ENDMACRO() MACRO(FEATURE_LAPACK_CONFIGURE_EXTERNAL) - REGISTER_FEATURE(LAPACK) CHECK_FOR_LAPACK_FUNCTIONS() ENDMACRO() diff --git a/deal.II/cmake/configure/configure_1_mpi.cmake b/deal.II/cmake/configure/configure_1_mpi.cmake index 1927e8ecbd..a73e27d962 100644 --- a/deal.II/cmake/configure/configure_1_mpi.cmake +++ b/deal.II/cmake/configure/configure_1_mpi.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -18,7 +18,7 @@ # Configuration for mpi support: # # We look for the C and Fortran libraries as well because they are needed -# by some external libraries: +# by some external libraries for the link interface: # MACRO(FEATURE_MPI_FIND_EXTERNAL var) @@ -137,6 +137,9 @@ MACRO(FEATURE_MPI_FIND_EXTERNAL var) SET(${var} TRUE) ENDIF() + # Hide some variables: + MARK_AS_ADVANCED(MPI_EXTRA_LIBRARY MPI_LIBRARY MPI_MPI_H) + # # Populate correct variables: # @@ -145,19 +148,6 @@ MACRO(FEATURE_MPI_FIND_EXTERNAL var) SET(MPI_CXX_FLAGS ${MPI_CXX_COMPILE_FLAGS}) SET(MPI_LINKER_FLAGS "${MPI_CXX_LINK_FLAGS}") - # Hide some variables: - MARK_AS_ADVANCED(MPI_EXTRA_LIBRARY MPI_LIBRARY MPI_MPI_H) - -ENDMACRO() - - -MACRO(FEATURE_MPI_CONFIGURE_EXTERNAL) - # - # The user has to know the location of the mpi headers as well: - # - SET(MPI_ADD_TO_USER_INCLUDE_DIRS TRUE) - - REGISTER_FEATURE(MPI) ENDMACRO() @@ -179,3 +169,8 @@ ENDMACRO() CONFIGURE_FEATURE(MPI) + +# +# The user has to know the location of the mpi headers as well: +# +SET(MPI_USER_INCLUDE_DIRS ${MPI_INCLUDE_DIRS}) diff --git a/deal.II/cmake/configure/configure_1_threads.cmake b/deal.II/cmake/configure/configure_1_threads.cmake index c7265653bb..bc698ad595 100644 --- a/deal.II/cmake/configure/configure_1_threads.cmake +++ b/deal.II/cmake/configure/configure_1_threads.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -33,7 +33,7 @@ MACRO(SETUP_THREADING) # # Switch the library preference back to prefer dynamic libraries if # DEAL_II_PREFER_STATIC_LIBS=TRUE but DEAL_II_STATIC_EXECUTABLE=FALSE. In - # this case system libraries should be linked dynamically. + # this case system libraries must be linked dynamically. # SWITCH_LIBRARY_PREFERENCE() @@ -63,7 +63,7 @@ MACRO(SETUP_THREADING) IF(NOT Threads_FOUND) # - # TODO: This is a dead end. Threading might be setup with internal TBB + # TODO: This is a dead end. Threading might be set up with internal TBB # so we have no way of returning unsuccessfully... # MESSAGE(FATAL_ERROR @@ -88,7 +88,7 @@ MACRO(SETUP_THREADING) ENDIF() ENDIF() - ADD_FLAGS(DEAL_II_LINKER_FLAGS "${CMAKE_THREAD_LIBS_INIT}") + ADD_FLAGS(THREADS_LINKER_FLAGS "${CMAKE_THREAD_LIBS_INIT}") # # Set up some posix thread specific configuration toggles: @@ -152,13 +152,10 @@ ENDMACRO() MACRO(FEATURE_THREADS_CONFIGURE_EXTERNAL) - REGISTER_FEATURE(TBB) - - # TODO: Refactor IF(CMAKE_BUILD_TYPE MATCHES "Debug") IF(TBB_WITH_DEBUG_LIB) - LIST(APPEND DEAL_II_DEFINITIONS_DEBUG "TBB_USE_DEBUG" "TBB_DO_ASSERT=1") - LIST(APPEND DEAL_II_USER_DEFINITIONS_DEBUG "TBB_USE_DEBUG" "TBB_DO_ASSERT=1") + LIST(APPEND THREADS_DEFINITIONS_DEBUG "TBB_USE_DEBUG" "TBB_DO_ASSERT=1") + LIST(APPEND THREADS_USER_DEFINITIONS_DEBUG "TBB_USE_DEBUG" "TBB_DO_ASSERT=1") ENDIF() ENDIF() @@ -169,15 +166,14 @@ MACRO(FEATURE_THREADS_CONFIGURE_EXTERNAL) IF( DEAL_II_WITH_CXX11 AND NOT DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE AND NOT CMAKE_CXX_COMPILER_ID MATCHES "GNU" ) - LIST(APPEND DEAL_II_DEFINITIONS "TBB_IMPLEMENT_CPP0X=1") - LIST(APPEND DEAL_II_USER_DEFINITIONS "TBB_IMPLEMENT_CPP0X=1") + LIST(APPEND THREADS_DEFINITIONS "TBB_IMPLEMENT_CPP0X=1") + LIST(APPEND THREADS_USER_DEFINITIONS "TBB_IMPLEMENT_CPP0X=1") ENDIF() SETUP_THREADING() - # TODO: Refactor this mess of a configure file... - SET(THREADS_LIBRARIES ${TBB_LIBRARIES}) - SET(THREADS_INCLUDE_DIRS ${TBB_INCLUDE_DIRS}) + LIST(APPEND THREADS_LIBRARIES ${TBB_LIBRARIES}) + LIST(APPEND THREADS_INCLUDE_DIRS ${TBB_INCLUDE_DIRS}) ENDMACRO() @@ -191,15 +187,15 @@ MACRO(FEATURE_THREADS_CONFIGURE_BUNDLED) # # We have to disable a bunch of warnings: # - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-parentheses") - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-long-long") + ENABLE_IF_SUPPORTED(THREADS_CXX_FLAGS "-Wno-parentheses") + ENABLE_IF_SUPPORTED(THREADS_CXX_FLAGS "-Wno-long-long") # # Add some definitions to use the header files in debug mode: # IF (CMAKE_BUILD_TYPE MATCHES "Debug") - LIST(APPEND DEAL_II_DEFINITIONS_DEBUG "TBB_USE_DEBUG" "TBB_DO_ASSERT=1") - LIST(APPEND DEAL_II_USER_DEFINITIONS_DEBUG "TBB_USE_DEBUG" "TBB_DO_ASSERT=1") + LIST(APPEND THREADS_DEFINITIONS_DEBUG "TBB_USE_DEBUG" "TBB_DO_ASSERT=1") + LIST(APPEND THREADS_USER_DEFINITIONS_DEBUG "TBB_USE_DEBUG" "TBB_DO_ASSERT=1") ENDIF() # @@ -209,20 +205,22 @@ MACRO(FEATURE_THREADS_CONFIGURE_BUNDLED) IF( DEAL_II_WITH_CXX11 AND NOT DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE AND NOT CMAKE_CXX_COMPILER_ID MATCHES "GNU" ) - LIST(APPEND DEAL_II_DEFINITIONS "TBB_IMPLEMENT_CPP0X=1") - LIST(APPEND DEAL_II_USER_DEFINITIONS "TBB_IMPLEMENT_CPP0X=1") + LIST(APPEND THREADS_DEFINITIONS "TBB_IMPLEMENT_CPP0X=1") + LIST(APPEND THREADS_USER_DEFINITIONS "TBB_IMPLEMENT_CPP0X=1") ENDIF() # # tbb uses dlopen/dlclose, so link against libdl.so as well: # + # TODO: Also necessary for external lib, use preference toggle + # FIND_LIBRARY(dl_LIBRARY NAMES dl) MARK_AS_ADVANCED(dl_LIBRARY) IF(NOT dl_LIBRARY MATCHES "-NOTFOUND") - LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${dl_LIBRARY}) + LIST(APPEND THREADS_LIBRARIES ${dl_LIBRARY}) ENDIF() - INCLUDE_DIRECTORIES(${TBB_FOLDER}/include) + LIST(APPEND THREADS_BUNDLED_INCLUDE_DIRS ${TBB_FOLDER}/include) ENDMACRO() diff --git a/deal.II/cmake/configure/configure_2_metis.cmake b/deal.II/cmake/configure/configure_2_metis.cmake index 1a49a2c7c2..739c7a6274 100644 --- a/deal.II/cmake/configure/configure_2_metis.cmake +++ b/deal.II/cmake/configure/configure_2_metis.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## diff --git a/deal.II/cmake/configure/configure_2_trilinos.cmake b/deal.II/cmake/configure/configure_2_trilinos.cmake index e04bbfac41..b7b0006211 100644 --- a/deal.II/cmake/configure/configure_2_trilinos.cmake +++ b/deal.II/cmake/configure/configure_2_trilinos.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -163,8 +163,8 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var) IF(DEAL_II_WITH_CXX11 AND NOT TRILINOS_SUPPORTS_CPP11) IF(TRILINOS_HAS_C99_TR1_WORKAROUND) - LIST(APPEND DEAL_II_DEFINITIONS "HAS_C99_TR1_CMATH") - LIST(APPEND DEAL_II_USER_DEFINITIONS "HAS_C99_TR1_CMATH") + LIST(APPEND TRILINOS_DEFINITIONS "HAS_C99_TR1_CMATH") + LIST(APPEND TRILINOS_USER_DEFINITIONS "HAS_C99_TR1_CMATH") ELSE() MESSAGE(STATUS "Could not find a sufficient Trilinos installation: " "The installation is not compatible with the C++ standard selected for " @@ -195,8 +195,7 @@ ENDMACRO() MACRO(FEATURE_TRILINOS_CONFIGURE_EXTERNAL) - SET(TRILINOS_ADD_TO_USER_INCLUDE_DIRS TRUE) - REGISTER_FEATURE(TRILINOS) + SET(TRILINOS_USER_INCLUDE_DIRS ${TRILINOS_INCLUDE_DIRS}) SET(DEAL_II_EXPAND_TRILINOS_VECTOR "TrilinosWrappers::Vector") SET(DEAL_II_EXPAND_TRILINOS_BLOCKVECTOR "TrilinosWrappers::BlockVector") @@ -208,9 +207,9 @@ MACRO(FEATURE_TRILINOS_CONFIGURE_EXTERNAL) # # Disable a bunch of warnings caused by Trilinos headers: # - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-unused") - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-extra") - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-overloaded-virtual") + ENABLE_IF_SUPPORTED(TRILINOS_CXX_FLAGS "-Wno-unused") + ENABLE_IF_SUPPORTED(TRILINOS_CXX_FLAGS "-Wno-extra") + ENABLE_IF_SUPPORTED(TRILINOS_CXX_FLAGS "-Wno-overloaded-virtual") ENDMACRO() diff --git a/deal.II/cmake/configure/configure_2_umfpack.cmake b/deal.II/cmake/configure/configure_2_umfpack.cmake index 56ac7e323d..f1d0d74513 100644 --- a/deal.II/cmake/configure/configure_2_umfpack.cmake +++ b/deal.II/cmake/configure/configure_2_umfpack.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -21,7 +21,7 @@ SET(FEATURE_UMFPACK_DEPENDS DEAL_II_WITH_LAPACK) MACRO(FEATURE_UMFPACK_CONFIGURE_BUNDLED) - INCLUDE_DIRECTORIES( + SET(UMFPACK_BUNDLED_INCLUDE_DIRS ${UMFPACK_FOLDER}/UMFPACK/Include ${UMFPACK_FOLDER}/AMD/Include ) diff --git a/deal.II/cmake/configure/configure_3_petsc.cmake b/deal.II/cmake/configure/configure_3_petsc.cmake index 6ed8f62c24..81cdd69e30 100644 --- a/deal.II/cmake/configure/configure_3_petsc.cmake +++ b/deal.II/cmake/configure/configure_3_petsc.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -112,15 +112,13 @@ ENDMACRO() MACRO(FEATURE_PETSC_CONFIGURE_EXTERNAL) - INCLUDE_DIRECTORIES(${PETSC_INCLUDE_DIRS}) - SET(PETSC_ADD_TO_USER_INCLUDE_DIRS TRUE) - REGISTER_FEATURE(PETSC) + SET(PETSC_USER_INCLUDE_DIRS ${PETSC_INCLUDE_DIRS}) # # Disable a bunch of warnings when compiling with petsc: # - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-long-long") + ENABLE_IF_SUPPORTED(PETSC_CXX_FLAGS "-Wno-long-long") SET(DEAL_II_EXPAND_PETSC_VECTOR "PETScWrappers::Vector") SET(DEAL_II_EXPAND_PETSC_BLOCKVECTOR "PETScWrappers::BlockVector") diff --git a/deal.II/cmake/configure/configure_boost.cmake b/deal.II/cmake/configure/configure_boost.cmake index de29304bbf..ec72b800a2 100644 --- a/deal.II/cmake/configure/configure_boost.cmake +++ b/deal.II/cmake/configure/configure_boost.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -105,19 +105,18 @@ MACRO(FEATURE_BOOST_FIND_EXTERNAL var) ENDMACRO() -# -# The user has to know the location of the boost headers as well: -# -SET(BOOST_ADD_TO_USER_INCLUDE_DIRS TRUE) - - MACRO(FEATURE_BOOST_CONFIGURE_BUNDLED) - INCLUDE_DIRECTORIES(${BOOST_FOLDER}/include) + SET(BOOST_BUNDLED_INCLUDE_DIRS ${BOOST_FOLDER}/include) ENDMACRO() CONFIGURE_FEATURE(BOOST) +# +# The user has to know the location of the boost headers as well: +# +SET(BOOST_USER_INCLUDE_DIRS ${BOOST_INCLUDE_DIRS}) + # # DEAL_II_WITH_BOOST is always required. # diff --git a/deal.II/cmake/configure/configure_functionparser.cmake b/deal.II/cmake/configure/configure_functionparser.cmake index c9abde129d..4794106652 100644 --- a/deal.II/cmake/configure/configure_functionparser.cmake +++ b/deal.II/cmake/configure/configure_functionparser.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -26,7 +26,7 @@ ENDMACRO() MACRO(FEATURE_FUNCTIONPARSER_CONFIGURE_BUNDLED) - INCLUDE_DIRECTORIES(${FUNCTIONPARSER_FOLDER}) + SET(FUNCTIONPARSER_BUNDLED_INCLUDE_DIRS ${FUNCTIONPARSER_FOLDER}) ENDMACRO() diff --git a/deal.II/cmake/configure/configure_hdf5.cmake b/deal.II/cmake/configure/configure_hdf5.cmake index 81e71ceffa..5dd027d482 100644 --- a/deal.II/cmake/configure/configure_hdf5.cmake +++ b/deal.II/cmake/configure/configure_hdf5.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -47,10 +47,10 @@ MACRO(FEATURE_HDF5_FIND_EXTERNAL var) ENDMACRO() +CONFIGURE_FEATURE(HDF5) + + # # The user has to know the location of the hdf5 headers as well: # -SET(HDF5_ADD_TO_USER_INCLUDE_DIRS TRUE) - - -CONFIGURE_FEATURE(HDF5) +SET(HDF5_USER_INCLUDE_DIRS ${HDF5_INCLUDE_DIRS}) diff --git a/deal.II/cmake/configure/configure_mumps.cmake b/deal.II/cmake/configure/configure_mumps.cmake index 4022f98026..a02e94d0b9 100644 --- a/deal.II/cmake/configure/configure_mumps.cmake +++ b/deal.II/cmake/configure/configure_mumps.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -21,10 +21,9 @@ SET(FEATURE_MUMPS_DEPENDS DEAL_II_WITH_MPI DEAL_II_WITH_LAPACK) +CONFIGURE_FEATURE(MUMPS) + # # The user has to know the location of the MUMPS headers as well: # -SET(MUMPS_ADD_TO_USER_INCLUDE_DIRS TRUE) - - -CONFIGURE_FEATURE(MUMPS) +SET(MUMPS_USER_INCLUDE_DIRS ${MUMPS_INCLUDE_DIRS}) diff --git a/deal.II/cmake/configure/configure_p4est.cmake b/deal.II/cmake/configure/configure_p4est.cmake index 4055c0f30c..a54643b60c 100644 --- a/deal.II/cmake/configure/configure_p4est.cmake +++ b/deal.II/cmake/configure/configure_p4est.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -75,10 +75,9 @@ MACRO(FEATURE_P4EST_FIND_EXTERNAL var) ENDMACRO() +CONFIGURE_FEATURE(P4EST) + # # The user has to know the location of the P4est headers as well: # -SET(P4EST_ADD_TO_USER_INCLUDE_DIRS TRUE) - - -CONFIGURE_FEATURE(P4EST) +SET(P4EST_USER_INCLUDE_DIRS ${P4EST_INCLUDE_DIRS}) diff --git a/deal.II/cmake/configure/configure_slepc.cmake b/deal.II/cmake/configure/configure_slepc.cmake index fdb87649d0..a4b97958fc 100644 --- a/deal.II/cmake/configure/configure_slepc.cmake +++ b/deal.II/cmake/configure/configure_slepc.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -58,12 +58,6 @@ MACRO(FEATURE_SLEPC_FIND_EXTERNAL var) ENDMACRO() -# -# The user has to know the location of the SLEPC headers as well: -# -SET(SLEPC_ADD_TO_USER_INCLUDE_DIRS TRUE) - - MACRO(FEATURE_SLEPC_ERROR_MESSAGE) MESSAGE(FATAL_ERROR "\n" "Could not find the SLEPc library!\n" @@ -84,3 +78,8 @@ ENDMACRO() CONFIGURE_FEATURE(SLEPC) + +# +# The user has to know the location of the SLEPC headers as well: +# +SET(SLEPC_USER_INCLUDE_DIRS ${SLEPC_INCLUDE_DIRS}) diff --git a/deal.II/cmake/macros/macro_configure_feature.cmake b/deal.II/cmake/macros/macro_configure_feature.cmake index 240e2bfa0d..615ff71d3c 100644 --- a/deal.II/cmake/macros/macro_configure_feature.cmake +++ b/deal.II/cmake/macros/macro_configure_feature.cmake @@ -233,11 +233,10 @@ MACRO(CONFIGURE_FEATURE _feature) IF(COMMAND FEATURE_${_feature}_CONFIGURE_EXTERNAL) RUN_COMMAND("FEATURE_${_feature}_CONFIGURE_EXTERNAL()") - ELSE() - REGISTER_FEATURE(${_feature}) ENDIF() MESSAGE(STATUS "DEAL_II_WITH_${_feature} successfully set up with external dependencies.") + LIST(APPEND DEAL_II_FEATURES ${_feature}) SET(FEATURE_${_feature}_EXTERNAL_CONFIGURED TRUE) SET_CACHED_OPTION(${_feature} ON) @@ -247,9 +246,12 @@ MACRO(CONFIGURE_FEATURE _feature) IF(FEATURE_${_feature}_HAVE_BUNDLED AND DEAL_II_ALLOW_BUNDLED) RUN_COMMAND("FEATURE_${_feature}_CONFIGURE_BUNDLED()") + MESSAGE(STATUS "DEAL_II_WITH_${_feature} successfully set up with bundled packages.") + LIST(APPEND DEAL_II_FEATURES ${_feature}) SET(FEATURE_${_feature}_BUNDLED_CONFIGURED TRUE) SET_CACHED_OPTION(${_feature} ON) + ELSE() IF(DEAL_II_WITH_${_feature}) IF(COMMAND FEATURE_${_feature}_ERROR_MESSAGE) diff --git a/deal.II/cmake/macros/macro_deal_ii_add_library.cmake b/deal.II/cmake/macros/macro_deal_ii_add_library.cmake index 8efacf6dfe..19d4883aae 100644 --- a/deal.II/cmake/macros/macro_deal_ii_add_library.cmake +++ b/deal.II/cmake/macros/macro_deal_ii_add_library.cmake @@ -39,7 +39,7 @@ MACRO(DEAL_II_ADD_LIBRARY _library) ) SET_TARGET_PROPERTIES(${_library}.${_build_lowercase} PROPERTIES - LINK_FLAGS "${DEAL_II_LINKER_FLAGS};${DEAL_II_LINKER_FLAGS_${_build}}" + LINK_FLAGS "${DEAL_II_LINKER_FLAGS} ${DEAL_II_LINKER_FLAGS_${_build}}" COMPILE_DEFINITIONS "${DEAL_II_DEFINITIONS};${DEAL_II_DEFINITIONS_${_build}}" COMPILE_FLAGS "${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${_build}}" LINKER_LANGUAGE "CXX" diff --git a/deal.II/cmake/macros/macro_register_feature.cmake b/deal.II/cmake/macros/macro_register_feature.cmake index 5c590280ee..1f6ed329a0 100644 --- a/deal.II/cmake/macros/macro_register_feature.cmake +++ b/deal.II/cmake/macros/macro_register_feature.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. ## @@ -24,9 +24,9 @@ # # This macro will add # -# _LIBRARIES -# _INCLUDE_DIRS(|_DEBUG|_RELEASE) -# _USER_INCLUDE_DIRS(|_DEBUG|_RELEASE) +# _LIBRARIES (respecting general, optimized, debug keyword) +# _LIBRARIES(_DEBUG|_RELEASE) +# _(|BUNDLED_|USER_)INCLUDE_DIRS # _DEFINITIONS(|_DEBUG|_RELEASE) # _USER_DEFINITIONS(|_DEBUG|_RELEASE) # _CXX_FLAGS(|_DEBUG|_RELEASE) @@ -35,38 +35,14 @@ # to the corresponding DEAL_II_* variables # - MACRO(REGISTER_FEATURE _feature) - # variables for include directories: - FOREACH(_var ${_feature}_INCLUDE_DIRS ${_feature}_INCLUDE_PATH) - IF(DEFINED ${_var}) - INCLUDE_DIRECTORIES(${${_var}}) - IF(${_feature}_ADD_TO_USER_INCLUDE_DIRS) - LIST(APPEND DEAL_II_USER_INCLUDE_DIRS ${${_var}}) - ENDIF() - ENDIF() - ENDFOREACH() - - # variables for linker flags: - FOREACH(_var ${_feature}_LINKER_FLAGS ${_feature}_LINK_FLAGS) - IF(DEFINED ${_var}) - ADD_FLAGS(DEAL_II_LINKER_FLAGS "${${_var}}") - ENDIF() - ENDFOREACH() - - # variables for compiler flags: - FOREACH(_var ${_feature}_CXX_FLAGS ${_feature}_COMPILE_FLAGS) - IF(DEFINED ${_var}) - ADD_FLAGS(DEAL_II_CXX_FLAGS "${${_var}}") - ENDIF() - ENDFOREACH() IF(DEFINED ${_feature}_LIBRARIES) # # Add ${_feature}_LIBRARIES to - # DEAL_II_EXTERNAL_LIBRARIES - # DEAL_II_EXTERNAL_LIBRARIES_DEBUG - # DEAL_II_EXTERNAL_LIBRARIES_RELEASE + # DEAL_II_LIBRARIES + # DEAL_II_LIBRARIES_DEBUG + # DEAL_II_LIBRARIES_RELEASE # depending on the "optmized", "debug" or "general" keyword # SET(_toggle "general") @@ -77,14 +53,34 @@ MACRO(REGISTER_FEATURE _feature) SET(_toggle "${_tmp}") ELSE() IF("${_toggle}" STREQUAL "general") - LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${_tmp}) + LIST(APPEND DEAL_II_LIBRARIES ${_tmp}) ELSEIF("${_toggle}" STREQUAL "debug") - LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_DEBUG ${_tmp}) + LIST(APPEND DEAL_II_LIBRARIES_DEBUG ${_tmp}) ELSEIF("${_toggle}" STREQUAL "optimized") - LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_RELEASE ${_tmp}) + LIST(APPEND DEAL_II_LIBRARIES_RELEASE ${_tmp}) ENDIF() ENDIF() ENDFOREACH() ENDIF() + FOREACH(_var + LIBRARIES_DEBUG LIBRARIES_RELEASE + INCLUDE_DIRS BUNDLED_INCLUDE_DIRS USER_INCLUDE_DIRS + DEFINITIONS DEFINITIONS_DEBUG DEFINITIONS_RELEASE + USER_DEFINITIONS USER_DEFINITIONS_DEBUG USER_DEFINITIONS_RELEASE + ) + IF(DEFINED ${_feature}_${_var}) + LIST(APPEND DEAL_II_${_var} ${${_feature}_${_var}}) + ENDIF() + ENDFOREACH() + + FOREACH(_var + CXX_FLAGS CXX_FLAGS_DEBUG CXX_FLAGS_RELEASE + LINKER_FLAGS LINKER_FLAGS_DEBUG LINKER_FLAGS_RELEASE + ) + IF(DEFINED ${_feature}_${_var}) + ADD_FLAGS(DEAL_II_${_var} "${${_feature}_${_var}}") + ENDIF() + ENDFOREACH() + ENDMACRO() diff --git a/deal.II/cmake/setup_finalize.cmake b/deal.II/cmake/setup_finalize.cmake index 4baa99b615..92ed551db2 100644 --- a/deal.II/cmake/setup_finalize.cmake +++ b/deal.II/cmake/setup_finalize.cmake @@ -52,18 +52,47 @@ FOREACH(_flag ${DEAL_II_REMOVED_FLAGS}) ENDFOREACH() # -# Deduplicate entries in DEAL_II_USER_INCLUDE_DIRS +# Deduplicate entries in *_INCLUDE_DIRS and *_LIBRARIES # -REMOVE_DUPLICATES(DEAL_II_USER_INCLUDE_DIRS) +FOREACH(_feature DEAL_II ${DEAL_II_FEATURES}) + FOREACH(_suffix INCLUDE_DIRS USER_INCLUDE_DIRS BUNDLED_INCLUDE_DIRS) + REMOVE_DUPLICATES(${_feature}_${_suffix}) + ENDFOREACH() + FOREACH(_suffix LIBRARIES LIBRARIES_RELEASE LIBRARIES_DEBUG) + REMOVE_DUPLICATES(${_feature}_${_suffix} REVERSE) + ENDFOREACH() +ENDFOREACH() # -# Deduplicate entries in DEAL_II_EXTERNAL_LIBRARIES(_...) -# in reverse order: +# Save base configuration into variables BASE_* for later use in +# setup_write_config.cmake: # -REMOVE_DUPLICATES(DEAL_II_EXTERNAL_LIBRARIES REVERSE) +FOREACH(_suffix + CXX_FLAGS CXX_FLAGS_RELEASE CXX_FLAGS_DEBUG + DEFINITIONS DEFINITIONS_RELEASE DEFINITIONS_DEBUG + USER_DEFINITIONS USER_DEFINITIONS_RELEASE USER_DEFINITIONS_DEBUG + LINKER_FLAGS LINKER_FLAGS_RELEASE LINKER_FLAGS_DEBUG + INCLUDE_DIRS USER_INCLUDE_DIRS BUNDLED_INCLUDE_DIRS + LIBRARIES LIBRARIES_RELEASE LIBRARIES_DEBUG + ) + SET(BASE_${_suffix} ${DEAL_II_${_suffix}}) +ENDFOREACH() -FOREACH(_build ${DEAL_II_BUILD_TYPES}) - REMOVE_DUPLICATES(DEAL_II_EXTERNAL_LIBRARIES_${_build} REVERSE) +# +# Register features: +# +FOREACH(_feature ${DEAL_II_FEATURES}) + REGISTER_FEATURE(${_feature}) +ENDFOREACH() + +# +# Deduplicate entries one more time :-] +# +FOREACH(_suffix INCLUDE_DIRS USER_INCLUDE_DIRS BUNDLED_INCLUDE_DIRS) + REMOVE_DUPLICATES(DEAL_II_${_suffix}) +ENDFOREACH() +FOREACH(_suffix LIBRARIES LIBRARIES_RELEASE LIBRARIES_DEBUG) + REMOVE_DUPLICATES(DEAL_II_${_suffix} REVERSE) ENDFOREACH() # @@ -78,10 +107,6 @@ FOREACH(_build ${DEAL_II_BUILD_TYPES}) ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_objects_${_build_lowercase} ) ENDFOREACH() -FILE(WRITE - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_source_includes - "" - ) # # Cleanup deal.IITargets.cmake in the build directory: diff --git a/deal.II/cmake/setup_write_config.cmake b/deal.II/cmake/setup_write_config.cmake index f3062a3907..ab23540631 100644 --- a/deal.II/cmake/setup_write_config.cmake +++ b/deal.II/cmake/setup_write_config.cmake @@ -76,31 +76,51 @@ ENDIF() _both("#\n") _detailed( -"# Compiler flags used for this build: -# DEAL_II_CXX_FLAGS: ${DEAL_II_CXX_FLAGS} +"# Base configuration (prior to feature configuration): +# DEAL_II_CXX_FLAGS: ${BASE_CXX_FLAGS} " ) IF(CMAKE_BUILD_TYPE MATCHES "Release") - _detailed("# DEAL_II_CXX_FLAGS_RELEASE: ${DEAL_II_CXX_FLAGS_RELEASE}\n") + _detailed("# DEAL_II_CXX_FLAGS_RELEASE: ${BASE_CXX_FLAGS_RELEASE}\n") ENDIF() IF(CMAKE_BUILD_TYPE MATCHES "Debug") - _detailed("# DEAL_II_CXX_FLAGS_DEBUG: ${DEAL_II_CXX_FLAGS_DEBUG}\n") + _detailed("# DEAL_II_CXX_FLAGS_DEBUG: ${BASE_CXX_FLAGS_DEBUG}\n") ENDIF() -_detailed("# DEAL_II_LINKER_FLAGS: ${DEAL_II_LINKER_FLAGS}\n") +_detailed("# DEAL_II_LINKER_FLAGS: ${BASE_LINKER_FLAGS}\n") IF(CMAKE_BUILD_TYPE MATCHES "Release") - _detailed("# DEAL_II_LINKER_FLAGS_RELEASE: ${DEAL_II_LINKER_FLAGS_RELEASE}\n") + _detailed("# DEAL_II_LINKER_FLAGS_RELEASE: ${BASE_LINKER_FLAGS_RELEASE}\n") ENDIF() IF(CMAKE_BUILD_TYPE MATCHES "Debug") - _detailed("# DEAL_II_LINKER_FLAGS_DEBUG: ${DEAL_II_LINKER_FLAGS_DEBUG}\n") + _detailed("# DEAL_II_LINKER_FLAGS_DEBUG: ${BASE_LINKER_FLAGS_DEBUG}\n") ENDIF() -_detailed("# DEAL_II_DEFINITIONS: ${DEAL_II_DEFINITIONS}\n") +_detailed("# DEAL_II_DEFINITIONS: ${BASE_DEFINITIONS}\n") IF(CMAKE_BUILD_TYPE MATCHES "Release") - _detailed("# DEAL_II_DEFINITIONS_RELEASE: ${DEAL_II_DEFINITIONS_RELEASE}\n") + _detailed("# DEAL_II_DEFINITIONS_RELEASE: ${BASE_DEFINITIONS_RELEASE}\n") ENDIF() IF(CMAKE_BUILD_TYPE MATCHES "Debug") - _detailed("# DEAL_II_DEFINITIONS_DEBUG: ${DEAL_II_DEFINITIONS_DEBUG}\n") + _detailed("# DEAL_II_DEFINITIONS_DEBUG: ${BASE_DEFINITIONS_DEBUG}\n") +ENDIF() + +_detailed("# DEAL_II_USER_DEFINITIONS: ${BASE_DEFINITIONS}\n") +IF(CMAKE_BUILD_TYPE MATCHES "Release") + _detailed("# DEAL_II_USER_DEFINITIONS_REL: ${BASE_DEFINITIONS_RELEASE}\n") +ENDIF() +IF(CMAKE_BUILD_TYPE MATCHES "Debug") + _detailed("# DEAL_II_USER_DEFINITIONS_DEB: ${BASE_DEFINITIONS_DEBUG}\n") +ENDIF() + +_detailed("# DEAL_II_INCLUDE_DIRS ${BASE_INCLUDE_DIRS}\n") +_detailed("# DEAL_II_USER_INCLUDE_DIRS: ${BASE_USER_INCLUDE_DIRS}\n") +_detailed("# DEAL_II_BUNDLED_INCLUDE_DIRS: ${BASE_BUNDLED_INCLUDE_DIRS}\n") + +_detailed("# DEAL_II_LIBRARIES: ${BASE_LIBRARIES}\n") +IF(CMAKE_BUILD_TYPE MATCHES "Release") + _detailed("# DEAL_II_LIBRARIES_RELEASE: ${BASE_LIBRARIES_RELEASE}\n") +ENDIF() +IF(CMAKE_BUILD_TYPE MATCHES "Debug") + _detailed("# DEAL_II_LIBRARIES_DEBUG: ${BASE_LIBRARIES_DEBUG}\n") ENDIF() _detailed("#\n") @@ -134,50 +154,14 @@ ENDFOREACH() FOREACH(_var ${_features}) IF(${${_var}}) - # FEATURE is enabled + + # + # The feature is enabled: + # STRING(REGEX REPLACE "^DEAL_II_WITH_" "" _feature ${_var}) IF(FEATURE_${_feature}_EXTERNAL_CONFIGURED) _both("# ${_var} set up with external dependencies\n") - - # - # Print out version number: - # - IF(DEFINED ${_feature}_VERSION) - _detailed("# ${_feature}_VERSION = ${${_feature}_VERSION}\n") - ENDIF() - - # - # Special version numbers: - # - IF(_feature MATCHES "THREADS" AND DEFINED TBB_VERSION) - _detailed("# TBB_VERSION = ${TBB_VERSION}\n") - ENDIF() - IF(_feature MATCHES "MPI" AND DEFINED OMPI_VERSION) - _detailed("# OMPI_VERSION = ${OMPI_VERSION}\n") - ENDIF() - - # - # Print out ${_feature}_DIR: - # - IF(NOT "${${_feature}_DIR}" STREQUAL "") - _detailed("# ${_feature}_DIR = ${${_feature}_DIR}\n") - ENDIF() - - # - # Print the feature configuration: - # - FOREACH(_var2 - CXX_COMPILER C_COMPILER Fortran_COMPILER LIBRARIES INCLUDE_DIRS - USER_INCLUDE_DIRS DEFINITIONS USER_DEFINITIONS CXX_FLAGS - LINKER_FLAGS - ) - IF(DEFINED ${_feature}_${_var2}) - _detailed("# ${_feature}_${_var2} = ${${_feature}_${_var2}}\n") - ENDIF() - ENDFOREACH() - ELSEIF(FEATURE_${_feature}_BUNDLED_CONFIGURED) - IF(DEAL_II_FORCE_BUNDLED_${_feature}) _both("# ${_var} set up with bundled packages (forced)\n") ELSE() @@ -186,6 +170,47 @@ FOREACH(_var ${_features}) ELSE() _both("# ${_var} = ${${_var}}\n") ENDIF() + + # + # Print out version number: + # + IF(DEFINED ${_feature}_VERSION) + _detailed("# ${_feature}_VERSION = ${${_feature}_VERSION}\n") + ENDIF() + + # + # Special version numbers: + # + IF(_feature MATCHES "THREADS" AND DEFINED TBB_VERSION) + _detailed("# TBB_VERSION = ${TBB_VERSION}\n") + ENDIF() + IF(_feature MATCHES "MPI" AND DEFINED OMPI_VERSION) + _detailed("# OMPI_VERSION = ${OMPI_VERSION}\n") + ENDIF() + + # + # Print out ${_feature}_DIR: + # + IF(NOT "${${_feature}_DIR}" STREQUAL "") + _detailed("# ${_feature}_DIR = ${${_feature}_DIR}\n") + ENDIF() + + # + # Print the feature configuration: + # + FOREACH(_var2 + C_COMPILER CXX_COMPILER Fortran_COMPILER + CXX_FLAGS CXX_FLAGS_RELEASE CXX_FLAGS_DEBUG + DEFINITIONS DEFINITIONS_RELEASE DEFINITIONS_DEBUG + USER_DEFINITIONS USER_DEFINITIONS_RELEASE USER_DEFINITIONS_DEBUG + LINKER_FLAGS LINKER_FLAGS_RELEASE LINKER_FLAGS_DEBUG + INCLUDE_DIRS USER_INCLUDE_DIRS BUNDLED_INCLUDE_DIRS + LIBRARIES LIBRARIES_RELEASE LIBRARIES_DEBUG + ) + IF(DEFINED ${_feature}_${_var2}) + _detailed("# ${_feature}_${_var2} = ${${_feature}_${_var2}}\n") + ENDIF() + ENDFOREACH() ELSE() # FEATURE is disabled _both("# ( ${_var} = ${${_var}} )\n") diff --git a/deal.II/doc/developers/cmake-internals.html b/deal.II/doc/developers/cmake-internals.html index 3517b168bb..48146dc0c2 100644 --- a/deal.II/doc/developers/cmake-internals.html +++ b/deal.II/doc/developers/cmake-internals.html @@ -343,18 +343,19 @@ RESET_CMAKE_REQUIRED() FATAL_ERROR must be avoided (the only exception is the REQUIRED keyword).
  • - If successful, the following uncached variables might be set: - + If the feature is successfully found, a subset of the following + uncached variables might be set:
     FEATURE_FOUND
    -FEATURE_LIBRARIES
    +FEATURE_LIBRARIES (with optimized, debug, release keywords)
    +FEATURE_LIBRARIES(_DEBUG|_RELEASE)
     FEATURE_INCLUDE_DIRS
    -FEATURE_LINKER_FLAGS
    +FEATURE_LINKER_FLAGS(|_DEBUG|_RELEASE)
    +FEATURE_CXX_FLAGS(|_DEBUG|_RELEASE)
    +FEATURE_DEFINITIONS(|_DEBUG|_RELEASE)
     
     FEATURE_VERSION
    -FEATURE_VERSION_MAJOR
    -FEATURE_VERSION_MINOR
    -FEATURE_VERSION_SUBMINOR
    +FEATURE_VERSION(_MAJOR|_MINOR|_SUBMINOR)
     
    There are obviously valid exceptions from this rule, though. @@ -363,6 +364,11 @@ There are obviously valid exceptions from this rule, though. "global" variables prefixed by FEATURE_ may be altered. Do not set DEAL_II_* or CMAKE_* variables directly! + +
  • + The find module must define a macro FEATURE_CLEAR that + unsets all cached variables, so that a subsequent call to the find + module starts a completely fresh features search.
  • A hint with FEATURE_DIR can be set up for convenience. It is best to start the Find module by @@ -400,11 +406,15 @@ SET(FEATURE_DIR "" CACHE PATH "An optional hint to a FEATURE directory") module is used to determine whether an external dependency can be resolved or not. Depending on the current state of DEAL_II_WITH_<FEATURE> (see - here) the variables + here) the + configuration variables
     FEATURE_LIBRARIES
    -FEATURE_INCLUDE_DIRS
    -FEATURE_LINKER_FLAGS
    +FEATURE_LIBRARIES(|_DEBUG|_RELEASE)
    +FEATURE_(|USER_|BUNDLED_)INCLUDE_DIRS
    +FEATURE_LINKER_FLAGS(|_DEBUG|_RELEASE)
    +FEATURE_CXX_FLAGS(|_DEBUG|_RELEASE)
    +FEATURE_DEFINITIONS(|_DEBUG|_RELEASE)
     
    are appended to the set of global variables and DEAL_II_WITH_<FEATURE> is set to @@ -458,7 +468,7 @@ FEATURE_<FEATURE>_ERROR_MESSAGE() (macro)
  • - In ./bundled/CMakeLists.txt: + In ./bundled/configure_bundled.cmake:
     FEATURE_<FEATURE>_HAVE_BUNDLED         (a boolean)
       - which should either be set to TRUE if all necessary libraries of the
    @@ -492,6 +502,15 @@ DEAL_II_FORCE_BUNDLED_<FEATURE>        (an option)
       LIST(APPEND ...), flags with ADD_FLAGS(...)
       (or if it is necessary to guard them with
       ENABLE_IF_SUPPORTED(...).)
    +

    +

    + Feature configuration must not be added directly to this variables but + to corresponding <FEATURE>_* variables, instead. + Feature configuration variables get appended to the below list of global + configuration variables automatically. +

    + +
    • The general (internal) logic for variables applies: @@ -503,27 +522,32 @@ DEAL_II_FORCE_BUNDLED_<FEATURE> (an option)
  • - For internal use, for setting necessary linker flags for the deal.II library: + For internal and external use, used to keep track of external + libraries, the deal.II library and user + programs have to be linked against:
      -
    • DEAL_II_LINKER_FLAGS -
    • DEAL_II_LINKER_FLAGS_DEBUG -
    • DEAL_II_LINKER_FLAGS_RELEASE +
    • DEAL_II_LIBRARIES +
    • DEAL_II_LIBRARIES_DEBUG +
    • DEAL_II_LIBRARIES_RELEASE
  • - For internal use, for setting necessary compiler flags, e.g. - -std=c++11 (if available): + For internal use, for setting necessary include dirs for the compilation of the + deal.II library:
      -
    • DEAL_II_CXX_FLAGS -
    • DEAL_II_CXX_FLAGS_DEBUG -
    • DEAL_II_CXX_FLAGS_RELEASE +
    • DEAL_II_INCLUDE_DIRS
    -
  • - For internal use, for setting necessary include dirs for the compilation of the - deal.II library: + Used to keep track of external include dirs, necessary for the + compilation of user programs:
      -
    • INCLUDE_DIRECTORIES(...) +
    • DEAL_II_USER_INCLUDE_DIRS +
    +
  • + Include dirs from bundled packages necessary for the compilation fo + the library and user projects out of the build directory: +
      +
    • DEAL_II_BUNDLED_INCLUDE_DIRS
  • @@ -535,17 +559,6 @@ DEAL_II_FORCE_BUNDLED_<FEATURE> (an option)
  • DEAL_II_DEFINITIONS_DEBUG
  • DEAL_II_DEFINITIONS_RELEASE - -
  • - For internal and external use, used to keep track of external - libraries, the deal.II library and user - programs have to be linked against: -
      -
    • DEAL_II_EXTERNAL_LIBRARIES -
    • DEAL_II_EXTERNAL_LIBRARIES_DEBUG -
    • DEAL_II_EXTERNAL_LIBRARIES_RELEASE -
    -
  • For external use, used to keep track of external preprocessor definitions, necessary for the compilation of user programs: @@ -556,11 +569,22 @@ DEAL_II_FORCE_BUNDLED_<FEATURE> (an option)
  • - Used to keep track of external include dirs, necessary for the - compilation of user programs: + For internal and external use, for setting necessary compiler flags, + e.g. -std=c++11 (if available):
      -
    • DEAL_II_USER_INCLUDE_DIRS +
    • DEAL_II_CXX_FLAGS +
    • DEAL_II_CXX_FLAGS_DEBUG +
    • DEAL_II_CXX_FLAGS_RELEASE
    + +
  • + For internal use, for setting necessary linker flags for the deal.II library: +
      +
    • DEAL_II_LINKER_FLAGS +
    • DEAL_II_LINKER_FLAGS_DEBUG +
    • DEAL_II_LINKER_FLAGS_RELEASE +
    +

    diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index 384bfde3a7..a083239b46 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -124,6 +124,13 @@ inconvenience this causes.

    Specific improvements

      +
    1. Reworked: External feature setup. Disabling a feature now cleans up + associated internal, cached variables. A per-feature linkage test now spots + common linking inconsistencies early in the configuration stage (and not + just after a complete compilation). +
      + (Matthias Maier, 2014/02/01) +
    2. New/fixed: The ParameterHandler::print_parameters_section method not worked for XML output. There is now a flag include_top_level_elements which prints all higher diff --git a/deal.II/source/CMakeLists.txt b/deal.II/source/CMakeLists.txt index 0525ca1b93..e16c106d46 100644 --- a/deal.II/source/CMakeLists.txt +++ b/deal.II/source/CMakeLists.txt @@ -21,12 +21,10 @@ MESSAGE(STATUS "Setting up library") # INCLUDE_DIRECTORIES( - BEFORE # Ensure deal.II include directories come first - # - # Reverse order due to BEFORE: - # - ${CMAKE_SOURCE_DIR}/include/ ${CMAKE_BINARY_DIR}/include/ + ${CMAKE_SOURCE_DIR}/include/ + ${DEAL_II_BUNDLED_INCLUDE_DIRS} + ${DEAL_II_INCLUDE_DIRS} ) # @@ -86,8 +84,8 @@ FOREACH(build ${DEAL_II_BUILD_TYPES}) ) TARGET_LINK_LIBRARIES(${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX} - ${DEAL_II_EXTERNAL_LIBRARIES_${build}} - ${DEAL_II_EXTERNAL_LIBRARIES} + ${DEAL_II_LIBRARIES_${build}} + ${DEAL_II_LIBRARIES} ) FILE(MAKE_DIRECTORY -- 2.39.5