From a9272f027c18c3514a782f38e06d54fa0797e02a Mon Sep 17 00:00:00 2001 From: maier Date: Wed, 8 Aug 2012 21:50:21 +0000 Subject: [PATCH] Process all necessary *.in files git-svn-id: https://svn.dealii.org/branches/branch_cmake@25790 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/CMakeLists.txt | 18 ++++- .../expand_instantiations/CMakeLists.txt | 25 +------ .../expand_instantiations/template-arguments | 75 ------------------- .../Macros/macro_expand_instantiations.cmake | 25 +++++++ deal.II/include/CMakeLists.txt | 9 +++ 5 files changed, 52 insertions(+), 100 deletions(-) delete mode 100644 deal.II/common/expand_instantiations/template-arguments create mode 100644 deal.II/contrib/cmake/Macros/macro_expand_instantiations.cmake create mode 100644 deal.II/include/CMakeLists.txt diff --git a/deal.II/CMakeLists.txt b/deal.II/CMakeLists.txt index 451fe32d01..b6c901072e 100644 --- a/deal.II/CMakeLists.txt +++ b/deal.II/CMakeLists.txt @@ -2,16 +2,26 @@ PROJECT (deal.II) set (VERSION "8.0.pre") CMAKE_MINIMUM_REQUIRED (VERSION 2.8.8) -SET (CMAKE_CXX_FLAGS "-std=c++0x -D_REENTRANT -fPIC -O2 -march=native") +#TODO: +SET (CMAKE_CXX_FLAGS "-std=c++0x -D_REENTRANT -fPIC -O2 -march=native") SET (CMAKE_INCLUDE_CURRENT_DIR "true") + +#TODO: INCLUDE_DIRECTORIES( - "${CMAKE_SOURCE_DIR}/contrib/tbb/tbb30_104oss/include" #TODO - "${CMAKE_SOURCE_DIR}/contrib" #TODO - "${CMAKE_SOURCE_DIR}/include/" + ${CMAKE_SOURCE_DIR}/contrib/tbb/tbb30_104oss/include #TODO + ${CMAKE_SOURCE_DIR}/contrib #TODO + + ${CMAKE_SOURCE_DIR}/include/ + ${CMAKE_BINARY_DIR}/configured/ ) + ADD_SUBDIRECTORY(common/expand_instantiations) +#ADD_SUBDIRECTORY(contrib) + +INCLUDE(${CMAKE_SOURCE_DIR}/contrib/cmake/Macros/macro_expand_instantiations.cmake) +ADD_SUBDIRECTORY(include) ADD_SUBDIRECTORY(source) diff --git a/deal.II/common/expand_instantiations/CMakeLists.txt b/deal.II/common/expand_instantiations/CMakeLists.txt index e1cc9bd64c..d42be95355 100644 --- a/deal.II/common/expand_instantiations/CMakeLists.txt +++ b/deal.II/common/expand_instantiations/CMakeLists.txt @@ -1,23 +1,6 @@ ADD_EXECUTABLE(expand_instantiations expand_instantiations.cc) -#TODO template-arguments.in - -MACRO(macro_expand_instantiations target inst_in_files) - FOREACH (inst_in_file ${inst_in_files}) - STRING(REGEX REPLACE "\\.in$" "" inst_file "${inst_in_file}" ) - ADD_CUSTOM_COMMAND ( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${inst_file} - DEPENDS expand_instantiations - COMMAND expand_instantiations - ARGS ${CMAKE_SOURCE_DIR}/common/expand_instantiations/template-arguments - < ${CMAKE_CURRENT_SOURCE_DIR}/${inst_in_file} - > ${CMAKE_CURRENT_BINARY_DIR}/${inst_file} - ) - SET(inst_targets - ${CMAKE_CURRENT_BINARY_DIR}/${inst_file} - ${inst_targets} - ) - ENDFOREACH() - ADD_CUSTOM_TARGET(${target}.inst ALL DEPENDS ${inst_targets}) - ADD_DEPENDENCIES(${target} ${target}.inst) -ENDMACRO() +CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/template-arguments.in + ${CMAKE_BINARY_DIR}/configured/template-arguments + ) diff --git a/deal.II/common/expand_instantiations/template-arguments b/deal.II/common/expand_instantiations/template-arguments deleted file mode 100644 index 4940694561..0000000000 --- a/deal.II/common/expand_instantiations/template-arguments +++ /dev/null @@ -1,75 +0,0 @@ -REAL_SCALARS := { double; float; long double } -COMPLEX_SCALARS := { std::complex; - std::complex; - std::complex } - -DERIVATIVE_TENSORS := { double; - Tensor<1,deal_II_dimension>; - Tensor<2,deal_II_dimension> } - -DEAL_II_VEC_TEMPLATES := { Vector; BlockVector } - -SERIAL_VECTORS := { Vector; - Vector ; - Vector; - - BlockVector; - BlockVector; - BlockVector; - - parallel::distributed::Vector; - parallel::distributed::Vector ; - parallel::distributed::Vector; - - parallel::distributed::BlockVector; - parallel::distributed::BlockVector ; - parallel::distributed::BlockVector; - - ; - ; - ; - ; - - ; - ; - ; - ; - } - -DOFHANDLERS := { DoFHandler; - hp::DoFHandler; - MGDoFHandler } - -DOFHANDLER_TEMPLATES := { DoFHandler; - hp::DoFHandler; - MGDoFHandler } - -TRIANGULATION_AND_DOFHANDLER_TEMPLATES := { Triangulation; - DoFHandler; - hp::DoFHandler; - MGDoFHandler} - -TRIANGULATION_AND_DOFHANDLERS := { Triangulation; - DoFHandler; - hp::DoFHandler; - MGDoFHandler } - - -FEVALUES_BASES := { FEValuesBase; - FEFaceValuesBase } - -SPARSITY_PATTERNS := { SparsityPattern; - CompressedSparsityPattern; - CompressedSetSparsityPattern; - CompressedSimpleSparsityPattern; - ; - - BlockSparsityPattern; - BlockCompressedSparsityPattern; - BlockCompressedSetSparsityPattern; - BlockCompressedSimpleSparsityPattern; - ; } - -DIMENSIONS := { 1; 2; 3 } - -SPACE_DIMENSIONS := { 1; 2; 3 } diff --git a/deal.II/contrib/cmake/Macros/macro_expand_instantiations.cmake b/deal.II/contrib/cmake/Macros/macro_expand_instantiations.cmake new file mode 100644 index 0000000000..7c6dcb2026 --- /dev/null +++ b/deal.II/contrib/cmake/Macros/macro_expand_instantiations.cmake @@ -0,0 +1,25 @@ +MACRO(macro_expand_instantiations target inst_in_files) + + FOREACH (inst_in_file ${inst_in_files}) + STRING(REGEX REPLACE "\\.in$" "" inst_file "${inst_in_file}" ) + + ADD_CUSTOM_COMMAND ( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${inst_file} + DEPENDS expand_instantiations + COMMAND expand_instantiations + ARGS ${CMAKE_BINARY_DIR}/configured/template-arguments + < ${CMAKE_CURRENT_SOURCE_DIR}/${inst_in_file} + > ${CMAKE_CURRENT_BINARY_DIR}/${inst_file} + ) + + SET(inst_targets + ${CMAKE_CURRENT_BINARY_DIR}/${inst_file} + ${inst_targets} + ) + ENDFOREACH() + + ADD_CUSTOM_TARGET(${target}.inst ALL DEPENDS ${inst_targets}) + + ADD_DEPENDENCIES(${target} ${target}.inst) + +ENDMACRO() diff --git a/deal.II/include/CMakeLists.txt b/deal.II/include/CMakeLists.txt new file mode 100644 index 0000000000..5540723382 --- /dev/null +++ b/deal.II/include/CMakeLists.txt @@ -0,0 +1,9 @@ +CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/deal.II/lac/lapack_templates.h.in + ${CMAKE_BINARY_DIR}/configured/deal.II/lac/lapack_templates.h #TODO + ) + +CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/deal.II/base/config.h.in + ${CMAKE_BINARY_DIR}/configured/deal.II/base/config.h #TODO + ) -- 2.39.5