From f8762fec7a349ced12cdaef382c47f065865c53f Mon Sep 17 00:00:00 2001 From: maier Date: Wed, 8 Aug 2012 21:49:28 +0000 Subject: [PATCH] So... this actually works ;-) git-svn-id: https://svn.dealii.org/branches/branch_cmake@25788 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/CMakeLists.txt | 2 +- .../expand_instantiations/CMakeLists.txt | 28 ++++++------- deal.II/source/CMakeLists.txt | 35 ++++++++-------- deal.II/source/distributed/CMakeLists.txt | 26 ++---------- deal.II/source/dofs/CMakeLists.txt | 15 ++++++- deal.II/source/fe/CMakeLists.txt | 40 ++++++++++++++++++- deal.II/source/grid/CMakeLists.txt | 20 +++++++++- deal.II/source/hp/CMakeLists.txt | 12 +++++- deal.II/source/lac/CMakeLists.txt | 25 ++++++++++-- deal.II/source/multigrid/CMakeLists.txt | 15 ++++++- deal.II/source/numerics/CMakeLists.txt | 26 +++++++++++- 11 files changed, 172 insertions(+), 72 deletions(-) diff --git a/deal.II/CMakeLists.txt b/deal.II/CMakeLists.txt index 6a44cc0c51..451fe32d01 100644 --- a/deal.II/CMakeLists.txt +++ b/deal.II/CMakeLists.txt @@ -2,7 +2,7 @@ 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 -Wall -Wfatal-errors -pedantic") +SET (CMAKE_CXX_FLAGS "-std=c++0x -D_REENTRANT -fPIC -O2 -march=native") SET (CMAKE_INCLUDE_CURRENT_DIR "true") diff --git a/deal.II/common/expand_instantiations/CMakeLists.txt b/deal.II/common/expand_instantiations/CMakeLists.txt index bbed2673e6..e1cc9bd64c 100644 --- a/deal.II/common/expand_instantiations/CMakeLists.txt +++ b/deal.II/common/expand_instantiations/CMakeLists.txt @@ -1,25 +1,23 @@ -#TODO template-arguments.in - ADD_EXECUTABLE(expand_instantiations expand_instantiations.cc) -GET_TARGET_PROPERTY ( - expand_instantiations_exe - expand_instantiations - LOCATION - ) +#TODO template-arguments.in -MACRO(macro_expand_instantiations inst_in_files) +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_exe} - ARGS - ~/template-arguments - < ${CMAKE_CURRENT_SOURCE_DIR}/${inst_in_file} - > ${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() diff --git a/deal.II/source/CMakeLists.txt b/deal.II/source/CMakeLists.txt index 9c09f65d0a..9aba1bf5a1 100644 --- a/deal.II/source/CMakeLists.txt +++ b/deal.II/source/CMakeLists.txt @@ -1,22 +1,21 @@ ADD_SUBDIRECTORY(base) ADD_SUBDIRECTORY(distributed) -#ADD_SUBDIRECTORY(dofs) -#ADD_SUBDIRECTORY(fe) -#ADD_SUBDIRECTORY(grid) -#ADD_SUBDIRECTORY(hp) -#ADD_SUBDIRECTORY(lac) -#ADD_SUBDIRECTORY(multigrid) -#ADD_SUBDIRECTORY(numerics) +ADD_SUBDIRECTORY(dofs) +ADD_SUBDIRECTORY(fe) +ADD_SUBDIRECTORY(grid) +ADD_SUBDIRECTORY(hp) +ADD_SUBDIRECTORY(lac) +ADD_SUBDIRECTORY(multigrid) +ADD_SUBDIRECTORY(numerics) ADD_LIBRARY(deal.II - $ - $ - - #$ - #$ - #$ - #$ - #$ - #$ - #$ - ) + $ + $ + $ + $ + $ + $ + $ + $ + $ + ) diff --git a/deal.II/source/distributed/CMakeLists.txt b/deal.II/source/distributed/CMakeLists.txt index 193ee448bf..48120e610a 100644 --- a/deal.II/source/distributed/CMakeLists.txt +++ b/deal.II/source/distributed/CMakeLists.txt @@ -1,4 +1,4 @@ -SET(src_distributed +SET(src grid_refinement.cc solution_transfer.cc tria.cc @@ -10,25 +10,5 @@ SET(inst_in_files tria.inst.in ) -GET_TARGET_PROPERTY ( - expand_instantiations_exe - expand_instantiations - LOCATION - ) - -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_exe} - ARGS - ~/template-arguments - < ${CMAKE_CURRENT_SOURCE_DIR}/${inst_in_file} - > ${CMAKE_CURRENT_BINARY_DIR}/${inst_file} - ) -ENDFOREACH() - -ADD_LIBRARY(obj_distributed OBJECT ${src_distributed}) - +ADD_LIBRARY(obj_distributed OBJECT ${src}) +macro_expand_instantiations(obj_distributed "${inst_in_files}") diff --git a/deal.II/source/dofs/CMakeLists.txt b/deal.II/source/dofs/CMakeLists.txt index 6c3736a8a3..37b156a4ba 100644 --- a/deal.II/source/dofs/CMakeLists.txt +++ b/deal.II/source/dofs/CMakeLists.txt @@ -1,4 +1,4 @@ -set(SRC_DOFS +SET(src block_info.cc dof_accessor.cc dof_faces.cc @@ -11,4 +11,15 @@ set(SRC_DOFS number_cache.cc ) -add_library(OBJ_DOFS OBJECT ${SRC_DOFS}) +SET(inst_in_files + block_info.inst.in + dof_accessor.inst.in + dof_handler.inst.in + dof_handler_policy.inst.in + dof_objects.inst.in + dof_renumbering.inst.in + dof_tools.inst.in + ) + +ADD_LIBRARY(obj_dofs OBJECT ${src}) +macro_expand_instantiations(obj_dofs "${inst_in_files}") diff --git a/deal.II/source/fe/CMakeLists.txt b/deal.II/source/fe/CMakeLists.txt index ab38f42ed0..f48c331f9d 100644 --- a/deal.II/source/fe/CMakeLists.txt +++ b/deal.II/source/fe/CMakeLists.txt @@ -1,4 +1,4 @@ -set(SRC_FE +SET(src fe_abf.cc fe_bdm.cc fe.cc @@ -29,4 +29,40 @@ set(SRC_FE mapping_q_eulerian.cc ) -add_library(OBJ_FE OBJECT ${SRC_FE}) +SET(inst_in_files + fe_abf.inst.in + fe_bdm.inst.in + fe_dgp.inst.in + fe_dgp_monomial.inst.in + fe_dgp_nonparametric.inst.in + fe_dgq.inst.in + fe_dg_vector.inst.in + fe_face.inst.in + fe.inst.in + fe_nedelec.inst.in + fe_nothing.inst.in + fe_poly.inst.in + fe_poly_tensor.inst.in + fe_q_hierarchical.inst.in + fe_q.inst.in + fe_raviart_thomas.inst.in + fe_raviart_thomas_nodal.inst.in + fe_system.inst.in + fe_tools.inst.in + fe_values.decl.1.inst.in + fe_values.decl.2.inst.in + fe_values.impl.1.inst.in + fe_values.impl.2.inst.in + fe_values.inst.in + mapping_c1.inst.in + mapping_cartesian.inst.in + mapping.inst.in + mapping_q1_eulerian.inst.in + mapping_q1.inst.in + mapping_q_eulerian.inst.in + mapping_q.inst.in + ) + +ADD_LIBRARY(obj_fe OBJECT ${src}) +macro_expand_instantiations(obj_fe "${inst_in_files}") + diff --git a/deal.II/source/grid/CMakeLists.txt b/deal.II/source/grid/CMakeLists.txt index 1e3d46617f..685ea71904 100644 --- a/deal.II/source/grid/CMakeLists.txt +++ b/deal.II/source/grid/CMakeLists.txt @@ -1,4 +1,4 @@ -set(SRC_GRID +SET(src grid_generator.cc grid_in.cc grid_out.cc @@ -16,4 +16,20 @@ set(SRC_GRID tria_objects.cc ) -add_library(OBJ_GRID OBJECT ${SRC_GRID}) +SET(inst_in_files + grid_generator.inst.in + grid_in.inst.in + grid_out.inst.in + grid_refinement.inst.in + grid_tools.inst.in + intergrid_map.inst.in + tria_accessor.inst.in + tria_boundary.inst.in + tria_boundary_lib.inst.in + tria.inst.in + tria_objects.inst.in + ) + +ADD_LIBRARY(obj_grid OBJECT ${src}) +macro_expand_instantiations(obj_grid "${inst_in_files}") + diff --git a/deal.II/source/hp/CMakeLists.txt b/deal.II/source/hp/CMakeLists.txt index 0b23fc20c1..038e1fa848 100644 --- a/deal.II/source/hp/CMakeLists.txt +++ b/deal.II/source/hp/CMakeLists.txt @@ -1,4 +1,4 @@ -set(SRC_HP +SET(src dof_faces.cc dof_handler.cc dof_levels.cc @@ -8,4 +8,12 @@ set(SRC_HP mapping_collection.cc ) -add_library(OBJ_HP OBJECT ${SRC_HP}) +SET(inst_in_files + dof_handler.inst.in + fe_collection.inst.in + fe_values.inst.in + mapping_collection.inst.in + ) + +ADD_LIBRARY(obj_hp OBJECT ${src}) +macro_expand_instantiations(obj_hp "${inst_in_files}") diff --git a/deal.II/source/lac/CMakeLists.txt b/deal.II/source/lac/CMakeLists.txt index 80ea10ef9d..1a0d77e5fa 100644 --- a/deal.II/source/lac/CMakeLists.txt +++ b/deal.II/source/lac/CMakeLists.txt @@ -1,4 +1,4 @@ -set(SRC_LAC +SET(src block_matrix_array.cc block_sparse_matrix.cc block_sparse_matrix_ez.cc @@ -58,6 +58,25 @@ set(SRC_LAC vector.cc vector_memory.cc vector_view.cc - ) +) + +SET(inst_in_files + block_sparse_matrix.inst.in + block_vector.inst.in + chunk_sparse_matrix.inst.in + full_matrix.inst.in + operator.inst.in + parallel_vector.inst.in + precondition_block.inst.in + relaxation_block.inst.in + sparse_matrix_ez.inst.in + sparse_matrix.inst.in + trilinos_vector_base.inst.in + vector.inst.in + vector_memory.inst.in + vector_view.inst.in +) + +ADD_LIBRARY(obj_lac OBJECT ${src}) +macro_expand_instantiations(obj_lac "${inst_in_files}") -add_library(OBJ_LAC OBJECT ${SRC_LAC}) diff --git a/deal.II/source/multigrid/CMakeLists.txt b/deal.II/source/multigrid/CMakeLists.txt index 2bc54cedf0..5e72531e90 100644 --- a/deal.II/source/multigrid/CMakeLists.txt +++ b/deal.II/source/multigrid/CMakeLists.txt @@ -1,4 +1,4 @@ -set(SRC_MULTIGRID +SET(src mg_base.cc mg_dof_accessor.cc mg_dof_handler.cc @@ -9,4 +9,15 @@ set(SRC_MULTIGRID multigrid.cc ) -add_library(OBJ_MULTIGRID OBJECT ${SRC_MULTIGRID}) +SET(inst_in_files + mg_dof_accessor.inst.in + mg_dof_handler.inst.in + mg_tools.inst.in + mg_transfer_block.inst.in + mg_transfer_component.inst.in + mg_transfer_prebuilt.inst.in + ) + +ADD_LIBRARY(obj_multigrid OBJECT ${src}) +macro_expand_instantiations(obj_multigrid "${inst_in_files}") + diff --git a/deal.II/source/numerics/CMakeLists.txt b/deal.II/source/numerics/CMakeLists.txt index 6b95ce27a3..4d270068e0 100644 --- a/deal.II/source/numerics/CMakeLists.txt +++ b/deal.II/source/numerics/CMakeLists.txt @@ -1,4 +1,4 @@ -set(SRC_NUMERICS +SET(src data_out.cc data_out_faces.cc data_out_rotation.cc @@ -20,4 +20,26 @@ set(SRC_NUMERICS vectors.cc ) -add_library(OBJ_NUMERICS OBJECT ${SRC_NUMERICS}) +SET(inst_in_files + data_out_faces.inst.in + data_out.inst.in + data_out_rotation.inst.in + data_out_stack.inst.in + data_postprocessor.inst.in + derivative_approximation.inst.in + error_estimator.inst.in + fe_field_function.inst.in + matrices.inst.in + matrix_free.inst.in + mesh_worker_info.inst.in + mesh_worker_vector_selector.inst.in + operator.inst.in + point_value_history.inst.in + solution_transfer.inst.in + time_dependent.inst.in + vectors.inst.in + ) + +ADD_LIBRARY(obj_numerics OBJECT ${src}) +macro_expand_instantiations(obj_numerics "${inst_in_files}") + -- 2.39.5