From: maier Date: Thu, 13 Sep 2012 14:36:56 +0000 (+0000) Subject: Reorganize the main CMakeLists.txt X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b92da1e134a3a34486050003dd0d5807fc5b0ec;p=dealii-svn.git Reorganize the main CMakeLists.txt git-svn-id: https://svn.dealii.org/branches/branch_cmake@26353 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/CMakeLists.txt b/deal.II/CMakeLists.txt index e3432869de..88b672de6a 100644 --- a/deal.II/CMakeLists.txt +++ b/deal.II/CMakeLists.txt @@ -1,6 +1,5 @@ SET(VERSION "8.0.pre") -# # # This is the main CMakeLists.txt file for the deal.II project # @@ -60,9 +59,13 @@ SET(VERSION "8.0.pre") # -# -# General configuration options: -# + + +########################################################################### +# # +# General configuration options: # +# # +########################################################################### OPTION(DEAL_II_WITH_FUNCTIONPARSER "Build deal.II with support for functionparser." @@ -132,6 +135,14 @@ OPTION(DEAL_II_COMPAT_MAPPING + +########################################################################### +# # +# Configuration: # +# # +########################################################################### + + # # General configuration for cmake: # @@ -140,14 +151,22 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) SET(CMAKE_INCLUDE_CURRENT_DIR true) +# +# Load all macros: +# +FILE(GLOB macro_files "contrib/cmake/macros/*.cmake") +FOREACH(file ${macro_files}) + MESSAGE(STATUS "Include ${file}") + INCLUDE(${file}) +ENDFOREACH() + SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} - "${CMAKE_SOURCE_DIR}/contrib/cmake/check/" - "${CMAKE_SOURCE_DIR}/contrib/cmake/configure/" - "${CMAKE_SOURCE_DIR}/contrib/cmake/macros/" "${CMAKE_SOURCE_DIR}/contrib/cmake/modules/" + "${CMAKE_SOURCE_DIR}/contrib/cmake/configure/" ) + # # We have to initialize some cached variable before PROJECT is called, so # configure the cached, user editable CMAKE_BUILD_TYPES, CMAKE_CXX_FLAGS, @@ -156,41 +175,21 @@ SET(CMAKE_MODULE_PATH INCLUDE(configure_build) # -# Now, set the project: +# Now, set the project and configure some deal_II specific variables: # PROJECT(deal.II) -# -# Set up deal.II specific variables -# - -SET(DEAL_II_PACKAGE_BUGREPORT "dealii@dealii.org") -SET(DEAL_II_PACKAGE_NAME "deal.II") -SET(DEAL_II_PACKAGE_TARNAME ${DEAL_II_PACKAGE_NAME}) -SET(DEAL_II_PACKAGE_VERSION ${VERSION}) -SET(DEAL_II_PACKAGE_STRING "${DEAL_II_PACKAGE_NAME} ${DEAL_II_PACKAGE_VERSION}") -SET(DEAL_II_PACKAGE_URL "") -STRING(REGEX REPLACE "^([0-9]+)\\..*" "\\1" DEAL_II_MAJOR "${VERSION}") -STRING(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" DEAL_II_MINOR "${VERSION}") -SET(DEAL_II_PATH ${CMAKE_INSTALL_PREFIX}) - - +INCLUDE(configure_deal_ii) # -# Now, configure a lot of things: -# - - -########################################################################### -# # -# FAT NOTE: # -# # -########################################################################### - +# #################### +# # FAT NOTE: # +# #################### # # To keep things clean, only the following cmake variables should be -# altered (beside setting a lot of DEAL_II_* definitions...) +# altered in the platform checks and features configuration +# (beside setting a lot of DEAL_II_* definitions...): # # CMAKE_SHARED_LINKER_FLAGS # @@ -213,51 +212,53 @@ SET(deal_ii_external_libraries) # library will be linked. # + # -# Platform checks: +# Run all system checks: # -INCLUDE(check_for_compiler_features) - -INCLUDE(check_for_cxx_features) +FILE(GLOB macro_files "contrib/cmake/check/*.cmake") +FOREACH(file ${macro_files}) + MESSAGE(STATUS "Include ${file}") + INCLUDE(${file}) +ENDFOREACH() -INCLUDE(check_for_compiler_bugs) # # Feature configuration: # -INCLUDE(macro_message_not_found) - IF(DEAL_II_WITH_FUNCTIONPARSER) INCLUDE(configure_functionparser) ENDIF() - IF(DEAL_II_WITH_MPI) INCLUDE(configure_mpi) ENDIF() - IF(DEAL_II_WITH_NETCDF) INCLUDE(configure_netcdf) ENDIF() - IF(DEAL_II_WITH_THREADS) INCLUDE(configure_threads) ENDIF() - # Boost depends on configuration variables set in configure_threads.cmake INCLUDE(configure_boost) - IF(DEAL_II_WITH_UMFPACK) INCLUDE(configure_umfpack) ENDIF() - IF(DEAL_II_WITH_ZLIB) INCLUDE(configure_zlib) ENDIF() + +########################################################################### +# # +# Compile the library: # +# # +########################################################################### + + # # Build the toolchain: # @@ -270,7 +271,6 @@ CONFIGURE_FILE( ) - # # Compile the library: # @@ -280,8 +280,6 @@ INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR}/include/ ) -INCLUDE(macro_expand_instantiations) - ADD_SUBDIRECTORY(include) ADD_SUBDIRECTORY(source)