============
- 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
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.
# 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()
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
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:
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)
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)
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:
# 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(
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()
# 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
$<TARGET_OBJECTS:obj_boost_serialization>
)
- 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
${LAPACK_LIBRARIES}
)
-
#
# TODO: Reduce to the really necessary parts.
#
LIST(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "${LAPACK_LIBRARIES}")
STRIP_FLAG(CMAKE_REQUIRED_FLAGS "${LAPACK_LINKER_FLAGS}")
-
SET(HAVE_LIBLAPACK TRUE)
SET(${var} TRUE)
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()
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}
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"
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