From 78be9703c599002d0e746ca8ff65dcdfc3b614ea Mon Sep 17 00:00:00 2001 From: maier Date: Mon, 17 Sep 2012 22:02:11 +0000 Subject: [PATCH] Reorganize the top level CMakeLists.txt file git-svn-id: https://svn.dealii.org/branches/branch_cmake@26457 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/CMakeLists.txt | 55 ++++++++----------- .../cmake/configure/configure_boost.cmake | 13 +++++ .../cmake/configure/configure_tbb.cmake | 2 +- ...les.cmake => setup_cached_variables.cmake} | 0 ...gure_deal_ii.cmake => setup_deal_ii.cmake} | 0 5 files changed, 38 insertions(+), 32 deletions(-) rename deal.II/contrib/cmake/configure/{configure_cached_variables.cmake => setup_cached_variables.cmake} (100%) rename deal.II/contrib/cmake/configure/{configure_deal_ii.cmake => setup_deal_ii.cmake} (100%) diff --git a/deal.II/CMakeLists.txt b/deal.II/CMakeLists.txt index 5ba9d52f16..d52358bc85 100644 --- a/deal.II/CMakeLists.txt +++ b/deal.II/CMakeLists.txt @@ -110,7 +110,6 @@ OPTION(DEAL_II_FORCE_CONTRIB_FUNCTIONPARSER "Always use the bundled functionparser library instead of an external one." OFF) - OPTION(DEAL_II_WITH_LAPACK "Build deal.II with support for LAPACK." OFF) @@ -175,6 +174,13 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) SET(CMAKE_INCLUDE_CURRENT_DIR true) +SET(CMAKE_MODULE_PATH + ${CMAKE_MODULE_PATH} + "${CMAKE_SOURCE_DIR}/contrib/cmake/modules/" + "${CMAKE_SOURCE_DIR}/contrib/cmake/configure/" + ) + + # # Load all macros: # @@ -184,26 +190,19 @@ FOREACH(file ${macro_files}) INCLUDE(${file}) ENDFOREACH() -SET(CMAKE_MODULE_PATH - ${CMAKE_MODULE_PATH} - "${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, # etc. variables at this point: # -INCLUDE(configure_cached_variables) +INCLUDE(setup_cached_variables) # # Now, set the project and configure some deal_II specific variables: # PROJECT(deal.II) - -INCLUDE(configure_deal_ii) +INCLUDE(setup_deal_ii) # @@ -251,24 +250,17 @@ ENDFOREACH() # # Feature configuration: # +FILE(GLOB configure_files "contrib/cmake/configure/configure_*.cmake") + +# Make sure configure_boost.cmake comes after configure_tbb.cmake: +LIST(SORT configure_files) +LIST(REVERSE configure_files) # :-] + +FOREACH(file ${configure_files}) + MESSAGE(STATUS "Include ${file}") + INCLUDE(${file}) +ENDFOREACH() -# -# TODO: Resolve this boost dependency so that we can automatically include -# configure_[...] files -# -INCLUDE(configure_arpack) -INCLUDE(configure_blas) -INCLUDE(configure_lapack) -INCLUDE(configure_functionparser) -INCLUDE(configure_metis) -INCLUDE(configure_mpi) -INCLUDE(configure_netcdf) -INCLUDE(configure_p4est) -INCLUDE(configure_tbb) -INCLUDE(configure_boost) # depends on variables defined in configure_tbb -INCLUDE(configure_trilinos) -INCLUDE(configure_umfpack) -INCLUDE(configure_zlib) @@ -285,10 +277,11 @@ INCLUDE(configure_zlib) ADD_SUBDIRECTORY(common) -CONFIGURE_FILE( - ${CMAKE_CURRENT_SOURCE_DIR}/Version.in - ${CMAKE_CURRENT_BINARY_DIR}/Version - ) +# TODO +# CONFIGURE_FILE( +# ${CMAKE_CURRENT_SOURCE_DIR}/Version.in +# ${CMAKE_CURRENT_BINARY_DIR}/Version +# ) # diff --git a/deal.II/contrib/cmake/configure/configure_boost.cmake b/deal.II/contrib/cmake/configure/configure_boost.cmake index e1b985eea4..b94bc1a501 100644 --- a/deal.II/contrib/cmake/configure/configure_boost.cmake +++ b/deal.II/contrib/cmake/configure/configure_boost.cmake @@ -2,11 +2,24 @@ # Configuration for the boost library: # +# # Always true. We need it :-] +# SET(DEAL_II_WITH_BOOST "ON" CACHE STRING "Build deal.II with support for boost." FORCE ) +# +# This configure script has to be included after configure_tbb. +# We need some of the variables defined in SETUP_THREADING for +# the setup of the contrib boost library (if used) +# +IF(NOT FEATURE_TBB_HAVE_CONTRIB) + MESSAGE(FATAL_ERROR + "Internal build system error: configure_boost.cmake included before configure_tbb.cmake" + ) +ENDIF() + MACRO(FEATURE_BOOST_FIND_EXTERNAL var) diff --git a/deal.II/contrib/cmake/configure/configure_tbb.cmake b/deal.II/contrib/cmake/configure/configure_tbb.cmake index ea8e1672ff..1a56771c3f 100644 --- a/deal.II/contrib/cmake/configure/configure_tbb.cmake +++ b/deal.II/contrib/cmake/configure/configure_tbb.cmake @@ -128,7 +128,7 @@ MACRO(FEATURE_TBB_CONFIGURE_CONTRIB var) # Add tbb directly to the object files of deal.II # - # Setup threading (before configurating our build...) + # Setup threading (before configuring our build...) # and if successfull return TRUE: SETUP_THREADING(${var}) diff --git a/deal.II/contrib/cmake/configure/configure_cached_variables.cmake b/deal.II/contrib/cmake/configure/setup_cached_variables.cmake similarity index 100% rename from deal.II/contrib/cmake/configure/configure_cached_variables.cmake rename to deal.II/contrib/cmake/configure/setup_cached_variables.cmake diff --git a/deal.II/contrib/cmake/configure/configure_deal_ii.cmake b/deal.II/contrib/cmake/configure/setup_deal_ii.cmake similarity index 100% rename from deal.II/contrib/cmake/configure/configure_deal_ii.cmake rename to deal.II/contrib/cmake/configure/setup_deal_ii.cmake -- 2.39.5