From: maier Date: Mon, 1 Oct 2012 13:15:13 +0000 (+0000) Subject: Big Cleanup and reorganization X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc5b65ff49fe308e8c85842605787bd71ea43b29;p=dealii-svn.git Big Cleanup and reorganization git-svn-id: https://svn.dealii.org/branches/branch_cmake@26895 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/CMakeLists.txt b/deal.II/CMakeLists.txt index 62544e0f4d..fc3311629c 100644 --- a/deal.II/CMakeLists.txt +++ b/deal.II/CMakeLists.txt @@ -1,6 +1,4 @@ -SET(VERSION "8.0.pre") - ########################################################################### ## ## ## See README.cmake for further details on how to use the cmake build ## @@ -17,145 +15,14 @@ SET(VERSION "8.0.pre") # -########################################################################### -# # -# 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: # @@ -179,14 +46,12 @@ ENDFOREACH() 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: # @@ -195,7 +60,6 @@ INCLUDE(setup_deal_ii) INCLUDE(setup_compiler_flags) - # # Run all system checks: # @@ -205,6 +69,12 @@ FOREACH(file ${check_files}) INCLUDE(${file}) ENDFOREACH() +# +# Include information about bundled libraries: +# +IF(DEAL_II_WITH_BUNDLED_DIRECTORY) + INCLUDE(bundled/CMakeLists.txt) +ENDIF() # # Feature configuration: @@ -218,14 +88,12 @@ FOREACH(file ${configure_files}) INCLUDE(${file}) ENDFOREACH() - # # Finalize the configuration: # INCLUDE(setup_finalize) - ########################################################################### # # # Compile and install the library: # @@ -239,21 +107,22 @@ ADD_SUBDIRECTORY(config) 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 # diff --git a/deal.II/README.CMAKE b/deal.II/README.CMAKE index 06581de748..325007fbce 100644 --- a/deal.II/README.CMAKE +++ b/deal.II/README.CMAKE @@ -398,6 +398,7 @@ CONFIGURATION 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 diff --git a/deal.II/bundled/CMakeLists.txt b/deal.II/bundled/CMakeLists.txt index 8101804155..70dc5344e8 100644 --- a/deal.II/bundled/CMakeLists.txt +++ b/deal.II/bundled/CMakeLists.txt @@ -1,15 +1,17 @@ - # -# TODO: -# The corresponding _folder and +# **) 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}) @@ -61,6 +136,13 @@ STRING(REGEX REPLACE "^[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") @@ -76,10 +158,10 @@ IF(DEAL_II_COMPONENT_COMPAT_FILES) 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 @@ -88,22 +170,22 @@ ELSE() 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} ) @@ -136,9 +218,17 @@ IF(CMAKE_BUILD_TYPE MATCHES "Release") 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() +