-SET(VERSION "8.0.pre")
-
###########################################################################
## ##
## See README.cmake for further details on how to use the cmake build ##
#
-###########################################################################
-# #
-# General configuration options: #
-# #
-###########################################################################
-
-#
-# Feature selection: external libraries and where to take them (if there
-# is a choice, e.g. from bundled vs external)
-#
-
-OPTION(DEAL_II_FEATURE_AUTODETECTION
-# Enables feature autodetection. This will automatically overwrite all
-# DEAL_II_WITH_<...> toggles depending on whether they can be supported or
-# not.
-# Short description:
- "Enables feature autodetection. This will automatically set DEAL_II_WITH_<...> options."
- ON)
-
-OPTION(DEAL_II_ALLOW_BUNDLED
-# Allow the use of bundled libraries bundled with the source tarball.
-# Note: If set to off DEAL_II_FORCE_BUNDLED* will still pull in bundled
-# packages, so to ensure that only external libraries are used
-# DEAL_II_ALLOW_BUNDLED as well as all DEAL_II_FORCE_BUNDLED* have to be
-# OFF
-# Short description:
- "Allow the use of libraries bundled with the source tarball. (DEAL_II_FORCE_BUNDLED* will overwrite this option.)"
- OFF)
-
-OPTION(DEAL_II_WITH_ARPACK
- "Build deal.II with support for ARPACK."
- OFF)
-
-SET(DEAL_II_WITH_BOOST
- # Always true. We need it :-]
- ON
- CACHE BOOL "Build deal.II with support for boost." FORCE
- )
-OPTION(DEAL_II_FORCE_BUNDLED_BOOST
- "Always use the bundled boost library instead of an external one."
- OFF)
-
-OPTION(DEAL_II_WITH_DOXYGEN
- "Build deal.II with support for doxygen and dot."
- OFF)
-
-OPTION(DEAL_II_WITH_FUNCTIONPARSER
- "Build deal.II with support for functionparser."
- OFF)
-OPTION(DEAL_II_FORCE_BUNDLED_FUNCTIONPARSER
- "Always use the bundled functionparser library instead of an external one."
- ON)
-
-OPTION(DEAL_II_WITH_LAPACK
- "Build deal.II with support for LAPACK."
- OFF)
-
-OPTION(DEAL_II_WITH_METIS
- "Build deal.II with support for Metis."
- OFF)
-
-OPTION(DEAL_II_WITH_MPI
- "Build deal.II with support for mpi."
- OFF)
-
-OPTION(DEAL_II_WITH_NETCDF
- "Build deal.II with support for netcdf."
- OFF)
-
-OPTION(DEAL_II_WITH_P4EST
- "Build deal.II with support for p4est."
- OFF)
-
-OPTION(DEAL_II_WITH_PETSC
- "Build deal.II with support for petsc."
- OFF)
-
-OPTION(DEAL_II_WITH_TBB
- "Build deal.II with support for tbb. This will enable thread support in deal.II."
- OFF)
-OPTION(DEAL_II_FORCE_BUNDLED_TBB
- "Always use the bundled tbb library instead of an external one."
- OFF)
-
-OPTION(DEAL_II_WITH_TRILINOS
- "Build deal.II with support for trilinos."
- OFF)
-
-OPTION(DEAL_II_WITH_UMFPACK
- "Build deal.II with support for UMFPACK."
- OFF)
-OPTION(DEAL_II_FORCE_BUNDLED_UMFPACK
- "Always use the bundled umfpack library instead of an external one."
- OFF)
-
-OPTION(DEAL_II_WITH_ZLIB
- "Build deal.II with support for zlib."
- OFF)
-
-#
-# Build configuration: configuration options regarding compilation and
-# installation of the deal.II library
-#
-
-OPTION(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS
- "configure sensible default CFLAGS and CXXFLAGS depending on platform, compiler and build target."
- ON)
-
-#
-# Component selection: configuration options regarding the setup of
-# different components of the deal.II library
-#
-
-OPTION(DEAL_II_COMPONENT_EXAMPLES
- "Enable configuration and installation of the example steps. This adds a COMPONENT \"examples\" to the build system."
- ON)
-
-OPTION(DEAL_II_COMPONENT_DOCUMENTATION
- "Enable configuration, build and installation of the documentation. This adds a COMPONENT \"documentation\" to the build system."
- OFF)
-
-OPTION(DEAL_II_COMPONENT_COMPAT_FILES
- "Enable installation of the example steps. This adds a COMPONENT \"compat_files\" to the build system."
- ON)
-
-OPTION(DEAL_II_COMPONENT_PROJECT_CONFIG
- # Enable configuration and installation of a cmake project config.
- # Useful for autodetection ( FIND_PACKAGE(DEAL_II) ) of the deal.II
- # library out of cmake build systems.
- "Enable configuration and installation of a cmake project config. This adds a COMPONENT \"project_config\" to the build system."
- ON)
-
-
###########################################################################
# #
# Configuration: #
# #
###########################################################################
+SET(VERSION "8.0.pre")
+
#
# General configuration for cmake:
#
INCLUDE(setup_external_macros)
-
#
# We have to initialize some cached variables before PROJECT is called, so
# do it at this point:
#
INCLUDE(setup_cached_variables)
-
#
# Now, set the project and setup the rest:
#
INCLUDE(setup_compiler_flags)
-
#
# Run all system checks:
#
INCLUDE(${file})
ENDFOREACH()
+#
+# Include information about bundled libraries:
+#
+IF(DEAL_II_WITH_BUNDLED_DIRECTORY)
+ INCLUDE(bundled/CMakeLists.txt)
+ENDIF()
#
# Feature configuration:
INCLUDE(${file})
ENDFOREACH()
-
#
# Finalize the configuration:
#
INCLUDE(setup_finalize)
-
###########################################################################
# #
# Compile and install the library: #
ADD_SUBDIRECTORY(scripts)
ADD_SUBDIRECTORY(include)
-
#
# Compile and install the library:
#
-ADD_SUBDIRECTORY(bundled)
+IF(DEAL_II_WITH_BUNDLED_DIRECTORY)
+ ADD_SUBDIRECTORY(bundled)
+ENDIF()
ADD_SUBDIRECTORY(source)
-
#
# Prepare some directories for installation
#
-ADD_SUBDIRECTORY(doc)
+IF(DEAL_II_WITH_DOC_DIRECTORY)
+ ADD_SUBDIRECTORY(doc)
+ENDIF()
ADD_SUBDIRECTORY(examples)
-
#
# Define some custom targets for convenience
#
DEAL_II_CMAKE_MACROS_RELDIR
DEAL_II_DOCUMENTATION_RELDIR
DEAL_II_EXAMPLES_RELDIR
+ DEAL_II_EXECUTABLE_RELDIR
DEAL_II_INCLUDE_RELDIR
DEAL_II_LIBRARY_RELDIR
DEAL_II_PROJECT_CONFIG_RELDIR
-
#
-# TODO:
-# The corresponding <feature>_folder and <feature_HAVE_BUNDLED variables
-# are set under cmake/configure/configure_*. This is a bit unfortunate and
-# should be corrected.
+# Export information about bundled library locations and do the actual
+# setup of compilation targets and installation here:
#
-IF(FEATURE_TBB_BUNDLED_CONFIGURED)
- ADD_SUBDIRECTORY(${tbb_folder}/src)
-ENDIF()
+#
+# Boost C++ libraries
+#
+SET(FEATURE_BOOST_HAVE_BUNDLED TRUE)
+OPTION(DEAL_II_FORCE_BUNDLED_BOOST
+ "Always use the bundled boost library instead of an external one."
+ OFF)
+SET(BOOST_FOLDER "${CMAKE_SOURCE_DIR}/bundled/boost-1.49.0")
IF(FEATURE_BOOST_BUNDLED_CONFIGURED)
INSTALL(DIRECTORY ${boost_folder}/include/boost
PATTERN ".svn" EXCLUDE
)
- ADD_SUBDIRECTORY(${boost_folder}/libs/serialization/src)
+ ADD_SUBDIRECTORY(${BOOST_FOLDER}/libs/serialization/src)
IF( DEAL_II_USE_MT AND NOT DEAL_II_CAN_USE_CXX11)
#
# we don't have to build BOOST itself only to get at this small part of
# it. it also ensures that we use the correct compiler and flags
#
- ADD_SUBDIRECTORY(${boost_folder}/libs/thread/src)
+ ADD_SUBDIRECTORY(${BOOST_FOLDER}/libs/thread/src)
ENDIF()
ENDIF()
+#
+# FunctionParser project:
+#
+SET(FEATURE_FUNCTIONPARSER_HAVE_BUNDLED TRUE)
+OPTION(DEAL_II_FORCE_BUNDLED_FUNCTIONPARSER
+ "Always use the bundled functionparser library instead of an external one."
+ ON)
+SET(FUNCTIONPARSER_FOLDER "${CMAKE_SOURCE_DIR}/bundled/functionparser/")
+
IF(FEATURE_FUNCTIONPARSER_BUNDLED_CONFIGURED)
- ADD_SUBDIRECTORY(${functionparser_folder})
+ ADD_SUBDIRECTORY(${FUNCTIONPARSER_PROJECT})
+ENDIF()
+
+
+#
+# Threading Building Blocks library
+#
+SET(FEATURE_TBB_HAVE_BUNDLED TRUE)
+SET(TBB_FOLDER "${CMAKE_SOURCE_DIR}/bundled/tbb30_104oss")
+OPTION(DEAL_II_FORCE_BUNDLED_TBB
+ "Always use the bundled tbb library instead of an external one."
+ OFF)
+
+IF(FEATURE_TBB_BUNDLED_CONFIGURED)
+ ADD_SUBDIRECTORY(${TBB_FOLDER}/src)
ENDIF()
+#
+# UMFPACK, AMD and UFCONFIG:
+#
+SET(FEATURE_UMFPACK_HAVE_BUNDLED TRUE)
+SET(UMFPACK_FOLDER "${CMAKE_SOURCE_DIR}/bundled/umfpack")
+OPTION(DEAL_II_FORCE_BUNDLED_UMFPACK
+ "Always use the bundled umfpack library instead of an external one."
+ OFF)
+
IF(FEATURE_UMFPACK_BUNDLED_CONFIGURED)
- ADD_SUBDIRECTORY(${umfpack_folder}/UMFPACK/Source)
- ADD_SUBDIRECTORY(${umfpack_folder}/AMD/Source)
+ ADD_SUBDIRECTORY(${UMFPACK_FOLDER}/UMFPACK/Source)
+ ADD_SUBDIRECTORY(${UMFPACK_FOLDER}/AMD/Source)
ENDIF()
# Configuration for the lapack library:
#
+OPTION(DEAL_II_WITH_LAPACK
+ "Build deal.II with support for LAPACK."
+ OFF)
+
MACRO(FEATURE_LAPACK_FIND_EXTERNAL var)
FIND_PACKAGE(LAPACK)
# Configuration for mpi support:
#
+OPTION(DEAL_II_WITH_MPI
+ "Build deal.II with support for mpi."
+ OFF)
+
+
MACRO(FEATURE_MPI_FIND_EXTERNAL var)
FIND_PACKAGE(MPI)
# Configuration for tbb support:
#
+OPTION(DEAL_II_WITH_TBB
+ "Build deal.II with support for tbb. This will enable thread support in deal.II."
+ OFF)
+
#
# Set up genereal threading:
ENDMACRO()
-SET(FEATURE_TBB_HAVE_BUNDLED TRUE)
-
-
MACRO(FEATURE_TBB_CONFIGURE_BUNDLED var)
#
)
ENDIF()
- #
- # TODO: Refactor and remove from here:
- #
- SET(tbb_folder "${CMAKE_SOURCE_DIR}/bundled/tbb30_104oss")
- INCLUDE_DIRECTORIES(${tbb_folder}/include)
+ INCLUDE_DIRECTORIES(${TBB_FOLDER}/include)
ENDMACRO()
# Configuration for the ARPACK library:
#
+OPTION(DEAL_II_WITH_ARPACK
+ "Build deal.II with support for doxygen and dot."
+ OFF)
+
+
SET(FEATURE_ARPACK_DEPENDS
# Currently, with enabled arpack support, we also need to setup
# LAPACK support in deal.II:
# Configuration for the boost library:
#
-
#
# This configure script has to be included after configure_tbb.
# We need some of the variables defined in SETUP_THREADING for
ENDIF()
+SET(DEAL_II_WITH_BOOST
+ # Always true. We need it :-]
+ ON
+ CACHE BOOL "Build deal.II with support for boost." FORCE
+ )
+
+
MACRO(FEATURE_BOOST_FIND_EXTERNAL var)
FIND_PACKAGE (Boost COMPONENTS serialization thread)
ENDMACRO()
-SET(FEATURE_BOOST_HAVE_BUNDLED TRUE)
-
-
MACRO(FEATURE_BOOST_CONFIGURE_BUNDLED var)
#
"BOOST_NO_HASH" "BOOST_NO_SLIST"
)
- SET(boost_folder "${CMAKE_SOURCE_DIR}/bundled/boost-1.49.0")
- INCLUDE_DIRECTORIES(${boost_folder}/include)
+ INCLUDE_DIRECTORIES(${BOOST_FOLDER}/include)
SET(${var} TRUE)
ENDMACRO()
CONFIGURE_FEATURE(BOOST)
-
#
# DEAL_II_WITH_BOOST is always required.
#
# Configuration for doxygen
#
+OPTION(DEAL_II_WITH_DOXYGEN
+ "Build deal.II with support for doxygen and dot."
+ OFF)
+
+
MACRO(FEATURE_DOXYGEN_FIND_EXTERNAL var)
FIND_PACKAGE(Doxygen)
# Configuration for functionparser
#
+OPTION(DEAL_II_WITH_FUNCTIONPARSER
+ "Build deal.II with support for functionparser."
+ OFF)
+
+
MACRO(FEATURE_FUNCTIONPARSER_FIND_EXTERNAL var)
MESSAGE(STATUS
"No module available for finding functionparser externally."
ENDMACRO()
-SET(FEATURE_FUNCTIONPARSER_HAVE_BUNDLED TRUE)
-
-
MACRO(FEATURE_FUNCTIONPARSER_CONFIGURE_BUNDLED var)
-
- SET(functionparser_folder "${CMAKE_SOURCE_DIR}/bundled/functionparser/")
INCLUDE_DIRECTORIES(${functionparser_folder})
-
SET(HAVE_FUNCTIONPARSER TRUE)
-
SET(${var} TRUE)
ENDMACRO()
# Configuration for the netcdf library:
#
+OPTION(DEAL_II_WITH_METIS
+ "Build deal.II with support for Metis."
+ OFF)
+
+
MACRO(FEATURE_METIS_FIND_EXTERNAL var)
FIND_PACKAGE(METIS)
# Configuration for the netcdf library:
#
+OPTION(DEAL_II_WITH_NETCDF
+ "Build deal.II with support for netcdf."
+ OFF)
+
+
MACRO(FEATURE_NETCDF_FIND_EXTERNAL var)
FIND_PACKAGE(NETCDF)
# Configuration for the p4est and sc libraries:
#
+OPTION(DEAL_II_WITH_P4EST
+ "Build deal.II with support for p4est."
+ OFF)
+
SET(FEATURE_P4EST_DEPENDS DEAL_II_WITH_MPI)
# Configuration for the petsc library:
#
+OPTION(DEAL_II_WITH_PETSC
+ "Build deal.II with support for petsc."
+ OFF)
+
+
MACRO(FEATURE_PETSC_FIND_EXTERNAL var)
FIND_PACKAGE(PETSC)
# Configuration for the trilinos library:
#
+OPTION(DEAL_II_WITH_TRILINOS
+ "Build deal.II with support for trilinos."
+ OFF)
+
MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var)
FIND_PACKAGE(TRILINOS)
# Configuration for the umfpack and amd libraries:
#
+OPTION(DEAL_II_WITH_UMFPACK
+ "Build deal.II with support for UMFPACK."
+ OFF)
+
SET(FEATURE_UMFPACK_DEPENDS
# Currently, with enabled umfpack support, we also need to setup
ENDMACRO()
-SET(FEATURE_UMFPACK_HAVE_BUNDLED TRUE)
-
-
MACRO(FEATURE_UMFPACK_CONFIGURE_BUNDLED var)
#
# DEAL_II_WITH_LAPACK will pull in an external BLAS library. So no need
# to setup something more than bundled UMFPACK here.
#
- SET(umfpack_folder "${CMAKE_SOURCE_DIR}/bundled/umfpack")
INCLUDE_DIRECTORIES(
- ${umfpack_folder}/UMFPACK/Include
- ${umfpack_folder}/AMD/Include
+ ${UMFPACK_FOLDER}/UMFPACK/Include
+ ${UMFPACK_FOLDER}/AMD/Include
)
SET(HAVE_LIBUMFPACK TRUE)
#
-# Set up deal.II specific definitions
+# Set up deal.II specific definitions and look for available components
#
# This file defines a long list of variables, used throughout the
# configuration to determine paths, locations and names:
#
-# General information about deal:
+# General configuration options:
+#
+# DEAL_II_FEATURE_AUTODETECTION **)
+# DEAL_II_ALLOW_BUNDLED **)
+# DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS **)
+# DEAL_II_COMPONENT_COMPAT_FILES **)
+# DEAL_II_COMPONENT_DOCUMENTATION **)
+# DEAL_II_COMPONENT_EXAMPLES **)
+#
+# General information about deal.II:
#
# DEAL_II_PACKAGE_NAME *)
# DEAL_II_PACKAGE_VERSION
# DEAL_II_CMAKE_MACROS_RELDIR *)
# DEAL_II_DOCUMENTATION_RELDIR *)
# DEAL_II_EXAMPLES_RELDIR *)
+# DEAL_II_EXECUTABLE_RELDIR *)
# DEAL_II_INCLUDE_RELDIR *)
# DEAL_II_LIBRARY_RELDIR *)
# DEAL_II_PROJECT_CONFIG_RELDIR *)
# DEAL_II_LIBRARIES_RELEASE
#
# DEAL_II_BUILD_TYPES
+# DEAL_II_WITH_BUNDLED_DIRECTORY
+# DEAL_II_WITH_DOC_DIRECTORY
+#
+# *) Values marked with *) can be overwritten by the command line via
+# -D<...>
+# **) Cached Option. Can be set via ccmake or on the command line via
+# -D<...>
+#
+
+
+#
+# Check whether the doc or bundled folder is available:
+#
+IF(EXISTS ${CMAKE_SOURCE_DIR}/bundled/CMakeLists.txt)
+ SET(DEAL_II_WITH_BUNDLED_DIRECTORY TRUE)
+ENDIF()
+
+IF(EXISTS ${CMAKE_SOURCE_DIR}/doc/CMakeLists.txt)
+ SET(DEAL_II_WITH_DOC_DIRECTORY TRUE)
+ENDIF()
+
+
+###########################################################################
+# #
+# General configuration options: #
+# #
+###########################################################################
+
+OPTION(DEAL_II_FEATURE_AUTODETECTION
+ "Enables feature autodetection. This will automatically set DEAL_II_WITH_<...> options."
+ ON)
+
+OPTION(DEAL_II_ALLOW_BUNDLED
+ "Allow the use of libraries bundled with the source tarball. (DEAL_II_FORCE_BUNDLED* will overwrite this option.)"
+ ON)
+
+#
+# Build configuration: configuration options regarding compilation and
+# installation of the deal.II library
+#
+OPTION(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS
+ "configure sensible default CFLAGS and CXXFLAGS depending on platform, compiler and build target."
+ ON)
+
#
-# *) Values marked with *) can be overwritten by the command line via
-# -D<...>
+# Component selection: configuration options regarding the setup of
+# different components of the deal.II library
#
+OPTION(DEAL_II_COMPONENT_COMPAT_FILES
+ "Enable installation of the example steps. This adds a COMPONENT \"compat_files\" to the build system."
+ ON)
+
+OPTION(DEAL_II_COMPONENT_EXAMPLES
+ "Enable configuration and installation of the example steps. This adds a COMPONENT \"examples\" to the build system."
+ ON)
+
+If(DEAL_II_WITH_DOC_DIRECTORY)
+ OPTION(DEAL_II_COMPONENT_DOCUMENTATION
+ "Enable configuration, build and installation of the documentation. This adds a COMPONENT \"documentation\" to the build system."
+ )
+ENDIF()
+
+
+###########################################################################
+# #
+# General information about deal.II: #
+# #
+###########################################################################
+
SET_IF_EMPTY(DEAL_II_PACKAGE_NAME "deal.II")
SET(DEAL_II_PACKAGE_VERSION ${VERSION})
"^[0-9]+\\.([0-9]+).*" "\\1" DEAL_II_VERSION_MINOR "${VERSION}"
)
+
+###########################################################################
+# #
+# Information about paths, install locations and names: #
+# #
+###########################################################################
+
SET(DEAL_II_PROJECT_CONFIG_NAME "${DEAL_II_PACKAGE_NAME}")
SET_IF_EMPTY(DEAL_II_BASE_NAME "deal_II")
SET_IF_EMPTY(DEAL_II_CMAKE_MACROS_RELDIR "cmake/macros")
SET_IF_EMPTY(DEAL_II_DOCUMENTATION_RELDIR "doc")
SET_IF_EMPTY(DEAL_II_EXAMPLES_RELDIR "examples")
+ SET_IF_EMPTY(DEAL_II_EXECUTABLE_RELDIR "bin")
SET_IF_EMPTY(DEAL_II_INCLUDE_RELDIR "include")
SET_IF_EMPTY(DEAL_II_LIBRARY_RELDIR "lib")
SET_IF_EMPTY(DEAL_II_PROJECT_CONFIG_RELDIR ".")
-
ELSE()
#
# IF DEAL_II_COMPONENT_COMPAT_FILES is not set, we assume that we have to
SET_IF_EMPTY(DEAL_II_CMAKE_MACROS_RELDIR "share/${DEAL_II_PACKAGE_NAME}/cmake/Macros")
SET_IF_EMPTY(DEAL_II_DOCUMENTATION_RELDIR "share/doc/${DEAL_II_PACKAGE_NAME}/html")
SET_IF_EMPTY(DEAL_II_EXAMPLES_RELDIR "share/doc/${DEAL_II_PACKAGE_NAME}/examples")
+ SET_IF_EMPTY(DEAL_II_EXECUTABLE_RELDIR "bin")
SET_IF_EMPTY(DEAL_II_INCLUDE_RELDIR "include")
SET_IF_EMPTY(DEAL_II_LIBRARY_RELDIR "lib${LIB_SUFFIX}")
SET_IF_EMPTY(DEAL_II_PROJECT_CONFIG_RELDIR "${DEAL_II_LIBRARY_RELDIR}/cmake/${DEAL_II_PROJECT_CONFIG_NAME}")
ENDIF()
-
LIST(APPEND DEAL_II_INCLUDE_DIRS
"${CMAKE_INSTALL_PREFIX}/${DEAL_II_INCLUDE_RELDIR}"
"${CMAKE_INSTALL_PREFIX}/${DEAL_II_INCLUDE_RELDIR}/deal.II"
"${CMAKE_INSTALL_PREFIX}/${DEAL_II_INCLUDE_RELDIR}/deal.II/bundled"
)
+
#
# A lot of magic to guess the resulting library names:
#
-
IF(BUILD_SHARED_LIBS)
SET(DEAL_II_LIBRARY_NAME_RELEASE ${CMAKE_SHARED_LIBRARY_PREFIX}${DEAL_II_BASE_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} )
SET(DEAL_II_LIBRARY_NAME_DEBUG ${CMAKE_SHARED_LIBRARY_PREFIX}${DEAL_II_BASE_NAME}${DEAL_II_DEBUG_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX} )
LIST(APPEND DEAL_II_BUILD_TYPES "RELEASE")
ENDIF()
+
+
+#
+# Cleanup some files used for storing the names of alle object targets that
+# will be bundled to the deal.II library. (Right now, i.e. cmake 2.8.8,
+# this is the only reliable way to get information in a global scope...)
+#
FOREACH(build ${DEAL_II_BUILD_TYPES})
STRING(TOLOWER "${build}" build_lowercase)
FILE(REMOVE
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_objects_${build_lowercase}
)
ENDFOREACH()
+