From: maier Date: Mon, 24 Sep 2012 19:37:00 +0000 (+0000) Subject: Make Wolfgang happy #2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0da6f917dc3bf30ea3fea74dbdcf007ae1f5010;p=dealii-svn.git Make Wolfgang happy #2 git-svn-id: https://svn.dealii.org/branches/branch_cmake@26678 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/README_CMAKE b/deal.II/README_CMAKE index 258ad1639e..9352ceed5b 100644 --- a/deal.II/README_CMAKE +++ b/deal.II/README_CMAKE @@ -410,25 +410,35 @@ DEVELOPMENT ============ - To keep things clean, only the following cmake variables should be - altered in the platform checks and feature configuration - (beside setting a lot of DEAL_II_* definitions...): + To keep things clean, only the following variables should appended in the + platform checks and feature configuration (beside setting a lot of + DEAL_II_* definitions...): For internal use: CMAKE_SHARED_LINKER_FLAGS + DEAL_II_SHARED_LINKER_FLAGS_DEBUG + DEAL_II_SHARED_LINKER_FLAGS_RELEASE + for setting necessary linker flags for the deal.II library. CMAKE_CXX_FLAGS (and CMAKE_C_FLAGS) + DEAL_II_CXX_FLAGS_DEBUG (and DEAL_II_C_FLAGS_DEBUG) + DEAL_II_CXX_FLAGS_RELEASE (and DEAL_II_C_FLAGS_RELEASE) + 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_DEFINITIONS(...) + DEAL_II_DEFINITIONS + DEAL_II_DEFINITIONS_DEBUG + DEAL_II_DEFINITIONS_RELEASE + For setting necessary preprocessor definitions ("-D<...>") for the compilation of the deal.II library @@ -440,18 +450,22 @@ DEVELOPMENT For internal and external use: DEAL_II_EXTERNAL_LIBRARIES + DEAL_II_EXTERNAL_LIBRARIES_DEBUG + DEAL_II_EXTERNAL_LIBRARIES_RELEASE Used to keep track of external libraries, the deal.II library and user programs have to be linked against. For external use: - DEAL_II_EXTERNAL_DEFINITIONS + DEAL_II_USER_DEFINITIONS + DEAL_II_USER_DEFINITIONS_DEBUG + DEAL_II_USER_DEFINITIONS_RELEASE Used to keep track of external preprocessor definitions, necessary for the compilation of user programs. - DEAL_II_EXTERNAL_INCLUDE_DIRS + DEAL_II_USER_INCLUDE_DIRS Used to keep track of external include dirs, necessary for the compilation of user programs. diff --git a/deal.II/cmake/check/check_for_compiler_features.cmake b/deal.II/cmake/check/check_for_compiler_features.cmake index c5f0ba59c1..61dc4fb87c 100644 --- a/deal.II/cmake/check/check_for_compiler_features.cmake +++ b/deal.II/cmake/check/check_for_compiler_features.cmake @@ -397,7 +397,7 @@ ENDIF() # so don't run the test on cygwin. # IF(NOT CMAKE_SYSTEM_NAME MATCHES "CYGWIN") - ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS_DEBUG "-Wa,--compress-debug-sections") - ENABLE_IF_SUPPORTED(CMAKE_C_FLAGS_DEBUG "-Wa,--compress-debug-sections") + ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "-Wa,--compress-debug-sections") + ENABLE_IF_SUPPORTED(DEAL_II_C_FLAGS_DEBUG "-Wa,--compress-debug-sections") ENDIF() diff --git a/deal.II/cmake/check/check_for_cxx_features.cmake b/deal.II/cmake/check/check_for_cxx_features.cmake index 30e86e00ae..f3483e47d5 100644 --- a/deal.II/cmake/check/check_for_cxx_features.cmake +++ b/deal.II/cmake/check/check_for_cxx_features.cmake @@ -151,7 +151,7 @@ IF(DEAL_II_HAVE_CXX11_FLAG) MESSAGE(STATUS "Insufficient C++11 support. Disabling -std=c++0x.") ENDIF() - IF(DEAL_II_CAN_USE_CXX1X) + IF(DEAL_II_CAN_USE_CXX11) # # Also test for a couple of C++11 things that we don't use in the # library but that users may want to use in their applications and that diff --git a/deal.II/cmake/configure/configure_1_mpi.cmake b/deal.II/cmake/configure/configure_1_mpi.cmake index c816fac89b..2b824ee9b7 100644 --- a/deal.II/cmake/configure/configure_1_mpi.cmake +++ b/deal.II/cmake/configure/configure_1_mpi.cmake @@ -26,7 +26,7 @@ MACRO(FEATURE_MPI_CONFIGURE_EXTERNAL var) INCLUDE_DIRECTORIES(${MPI_CXX_INCLUDE_PATH}) # The user has to know the location of the mpi headers as well: - LIST(APPEND DEAL_II_EXTERNAL_INCLUDE_DIRS ${MPI_CXX_INCLUDE_PATH}) + LIST(APPEND DEAL_II_USER_INCLUDE_DIRS ${MPI_CXX_INCLUDE_PATH}) # TODO: Set up the rest: diff --git a/deal.II/cmake/configure/configure_1_tbb.cmake b/deal.II/cmake/configure/configure_1_tbb.cmake index 353ef9edf7..97d63bb986 100644 --- a/deal.II/cmake/configure/configure_1_tbb.cmake +++ b/deal.II/cmake/configure/configure_1_tbb.cmake @@ -24,7 +24,7 @@ MACRO(SETUP_THREADING var) SET(DEAL_II_USE_MT TRUE) # - # Set up some posix threads specific configuration toggles: + # Set up some posix thread specific configuration toggles: # IF(CMAKE_USE_PTHREADS_INIT) SET(DEAL_II_USE_MT_POSIX TRUE) @@ -72,8 +72,8 @@ MACRO(SETUP_THREADING var) STRIP_FLAG(CMAKE_REQUIRED_FLAGS "${CMAKE_THREAD_LIBS_INIT}") IF(NOT DEAL_II_HAVE_SANE_MT_DEFINITIONS) - ADD_DEFINITIONS("-D_REENTRANT" "-D_THREAD_SAFE") - LIST(APPEND DEAL_II_EXTERNAL_DEFINITIONS "-D_REENTRANT" "-D_THREAD_SAFE") # TODO: Necessary? + LIST(APPEND DEAL_II_DEFINITIONS "-D_REENTRANT" "-D_THREAD_SAFE") + LIST(APPEND DEAL_II_USER_DEFINITIONS "-D_REENTRANT" "-D_THREAD_SAFE") # TODO: Necessary? ENDIF() ENDIF(Threads_FOUND) @@ -100,18 +100,22 @@ MACRO(FEATURE_TBB_CONFIGURE_EXTERNAL var) IF (CMAKE_BUILD_TYPE MATCHES "Debug") IF(TBB_DEBUG_FOUND) - LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${TBB_DEBUG_LIBRARY}) - ADD_DEFINITIONS("-DTBB_USE_DEBUG=1" "-DTBB_DO_ASSERT=1") + LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_DEBUG ${TBB_DEBUG_LIBRARY}) + LIST(APPEND DEAL_II_DEFINITIONS_DEBUG + "-DTBB_USE_DEBUG=1" + "-DTBB_DO_ASSERT=1" + ) ELSE() MESSAGE(STATUS - "deal.II was configured with CMAKE_BUILD_TYPE=Debug but no debug tbb " - "library was found. The regular tbb library will be used instead." + "No debug tbb library was found. " + "The regular tbb lib will be used for the debug target instead." ) - LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${TBB_LIBRARY}) + LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_DEBUG ${TBB_LIBRARY}) ENDIF() + ENDIF() - ELSE() - LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${TBB_LIBRARY}) + IF (CMAKE_BUILD_TYPE MATCHES "Release") + LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_RELEASE ${TBB_LIBRARY}) ENDIF() # Setup threading and if successfull return TRUE: @@ -143,7 +147,9 @@ MACRO(FEATURE_TBB_CONFIGURE_CONTRIB var) # Add some definitions to use the header files in debug mode: # IF (CMAKE_BUILD_TYPE MATCHES "Debug") - ADD_DEFINITIONS("-DTBB_DO_DEBUG=1" "-DTBB_DO_ASSERT=1") + LIST(APPEND DEAL_II_DEFINITIONS_DEBUG + "-DTBB_DO_DEBUG=1" "-DTBB_DO_ASSERT=1" + ) ENDIF() INCLUDE_DIRECTORIES( diff --git a/deal.II/cmake/configure/configure_boost.cmake b/deal.II/cmake/configure/configure_boost.cmake index 467239ad82..f1ef23ce9c 100644 --- a/deal.II/cmake/configure/configure_boost.cmake +++ b/deal.II/cmake/configure/configure_boost.cmake @@ -33,11 +33,13 @@ MACRO(FEATURE_BOOST_CONFIGURE_EXTERNAL var) INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIR}) IF (CMAKE_BUILD_TYPE MATCHES "Debug") - LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES + LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_DEBUG ${Boost_THREAD_LIBRARY_DEBUG} ${Boost_SERIALIZATION_LIBRARY_DEBUG} ) - ELSE() - LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES + ENDIF() + + IF (CMAKE_BUILD_TYPE MATCHES "Release") + LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_RELEASE ${Boost_THREAD_LIBRARY_RELEASE} ${Boost_SERIALIZATION_LIBRARY_RELEASE} ) ENDIF() @@ -58,8 +60,12 @@ MACRO(FEATURE_BOOST_CONFIGURE_CONTRIB var) # We need to set some definitions to use the headers of the bundled boost # library: # - ADD_DEFINITIONS("-DBOOST_NO_HASH" "-DBOOST_NO_SLIST") - LIST(APPEND DEAL_II_EXTERNAL_DEFINIITONS "-DBOOST_NO_HASH" "-DBOOST_NO_SLIST") + LIST(APPEND DEAL_II_DEFINITIONS + "-DBOOST_NO_HASH" "-DBOOST_NO_SLIST" + ) + LIST(APPEND DEAL_II_USER_DEFINIITONS + "-DBOOST_NO_HASH" "-DBOOST_NO_SLIST" + ) INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/contrib/boost-1.49.0/include @@ -73,9 +79,9 @@ MACRO(FEATURE_BOOST_CONFIGURE_CONTRIB var) $ ) - IF( DEAL_II_USE_MT AND NOT DEAL_II_CAN_USE_CXX1X) + IF( DEAL_II_USE_MT AND NOT DEAL_II_CAN_USE_CXX11) # - # If the C++ compiler doesn't completely support the C++1x standard + # If the C++ compiler doesn't completely support the C++11 standard # (and consequently we can't use std::thread, std::mutex, etc), then # include all the files that form BOOST's thread implementation so that # we don't have to build BOOST itself only to get at this small part of diff --git a/deal.II/cmake/configure/configure_lapack.cmake b/deal.II/cmake/configure/configure_lapack.cmake index 33de4350ed..842e5cfc61 100644 --- a/deal.II/cmake/configure/configure_lapack.cmake +++ b/deal.II/cmake/configure/configure_lapack.cmake @@ -22,7 +22,6 @@ MACRO(FEATURE_LAPACK_CONFIGURE_EXTERNAL var) ${LAPACK_LIBRARIES} ) - # # TODO: Reduce to the really necessary parts. # @@ -66,7 +65,6 @@ MACRO(FEATURE_LAPACK_CONFIGURE_EXTERNAL var) LIST(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "${LAPACK_LIBRARIES}") STRIP_FLAG(CMAKE_REQUIRED_FLAGS "${LAPACK_LINKER_FLAGS}") - SET(HAVE_LIBLAPACK TRUE) SET(${var} TRUE) diff --git a/deal.II/cmake/configure/configure_p4est.cmake b/deal.II/cmake/configure/configure_p4est.cmake index 8316026eb5..3dc89cf85d 100644 --- a/deal.II/cmake/configure/configure_p4est.cmake +++ b/deal.II/cmake/configure/configure_p4est.cmake @@ -47,25 +47,26 @@ MACRO(FEATURE_P4EST_CONFIGURE_EXTERNAL var) INCLUDE_DIRECTORIES(${P4EST_INCLUDE_DIR} ${SC_INCLUDE_DIR}) # The user has to know the location of the p4est headers as well: - LIST(APPEND DEAL_II_EXTERNAL_INCLUDE_DIRS ${P4EST_INCLUDE_DIR} ${SC_INCLUDE_DIR}) + LIST(APPEND DEAL_II_USER_INCLUDE_DIRS ${P4EST_INCLUDE_DIR} ${SC_INCLUDE_DIR}) IF (CMAKE_BUILD_TYPE MATCHES "Debug") IF(P4EST_DEBUG_FOUND AND SC_DEBUG_FOUND) - LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES + LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_DEBUG ${P4EST_DEBUG_LIBRARY} ${SC_DEBUG_LIBRARY} ) ELSE() - MESSAGE(WARNING "\n" - "deal.II was configured with CMAKE_BUILD_TYPE=Debug but no debug p4est and\n" - "sc libraries were found. The regular p4est and sc libraries will be used\n" - "instead.\n\n" + MESSAGE(STATUS + "No debug p4est and sc libraries were found. " + "The regular p4est and sc libs will be used for the debug target instead." ) - LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES + LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_DEBUG ${P4EST_LIBRARY} ${SC_LIBRARY} ) ENDIF() - ELSE() - LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES + ENDIF() + + IF (CMAKE_BUILD_TYPE MATCHES "Release") + LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_RELEASE ${P4EST_LIBRARY} ${SC_LIBRARY} ) ENDIF() diff --git a/deal.II/cmake/configure/configure_petsc.cmake b/deal.II/cmake/configure/configure_petsc.cmake index 67bbe8a503..a245e4a873 100644 --- a/deal.II/cmake/configure/configure_petsc.cmake +++ b/deal.II/cmake/configure/configure_petsc.cmake @@ -50,8 +50,8 @@ MACRO(FEATURE_PETSC_CONFIGURE_EXTERNAL var) INCLUDE_DIRECTORIES(${PETSC_INCLUDE_DIRS}) - # The user has to know the location of the petsc headers as well: # TODO - # LIST(APPEND DEAL_II_EXTERNAL_INCLUDE_DIRS ${PETSC_INCLUDE_DIRS}) + # The user has to know the location of the petsc headers as well: # TODO: Really? + # LIST(APPEND DEAL_II_USER_INCLUDE_DIRS ${PETSC_INCLUDE_DIRS}) LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${PETSC_LIBRARIES} diff --git a/deal.II/cmake/configure/configure_trilinos.cmake b/deal.II/cmake/configure/configure_trilinos.cmake index cb92849238..4c3770cb77 100644 --- a/deal.II/cmake/configure/configure_trilinos.cmake +++ b/deal.II/cmake/configure/configure_trilinos.cmake @@ -129,8 +129,8 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var) STRIP_FLAG(CMAKE_REQUIRED_FLAGS "-DHAS_C99_TR1_CMATH") IF(TRILINOS_HAS_C99_TR1_WORKAROUND) - ADD_DEFINITIONS("-DHAS_C99_TR1_CMATH") - LIST(APPEND DEAL_II_EXTERNAL_DEFINITIONS "-DHAS_C99_TR1_CMATH") + LIST(APPEND DEAL_II_DEFINITIONS "-DHAS_C99_TR1_CMATH") + LIST(APPEND DEAL_II_USER_DEFINITIONS "-DHAS_C99_TR1_CMATH") ELSE() MESSAGE(WARNING "\n" "Your Trilinos installation is not compatible with the C++ standard selected for\n" @@ -150,7 +150,7 @@ MACRO(FEATURE_TRILINOS_CONFIGURE_EXTERNAL var) 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_USER_INCLUDE_DIRS ${TRILINOS_INCLUDE_DIRS}) LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES