From 2f1db3bc934c42cbe410a6cf32664ab4f31afc12 Mon Sep 17 00:00:00 2001 From: maier Date: Wed, 27 Mar 2013 19:21:38 +0000 Subject: [PATCH] CMake: Improve IDE support: - Add headers and inst files to OBJECT targets - Add OBJECT targets for "header only" template stuff git-svn-id: https://svn.dealii.org/branches/branch_cmake@29084 0785d39b-7218-0410-832d-ea1e28bc413d --- .../macros/macro_deal_ii_add_library.cmake | 1 + deal.II/source/CMakeLists.txt | 2 ++ deal.II/source/algorithms/CMakeLists.txt | 24 +++++++++++++++++++ deal.II/source/base/CMakeLists.txt | 10 ++++++-- deal.II/source/distributed/CMakeLists.txt | 12 ++++++---- deal.II/source/dofs/CMakeLists.txt | 12 ++++++---- deal.II/source/fe/CMakeLists.txt | 12 ++++++---- deal.II/source/grid/CMakeLists.txt | 12 ++++++---- deal.II/source/hp/CMakeLists.txt | 12 ++++++---- deal.II/source/integrators/CMakeLists.txt | 24 +++++++++++++++++++ deal.II/source/lac/CMakeLists.txt | 12 ++++++---- deal.II/source/matrix_free/CMakeLists.txt | 24 +++++++++++++++++++ deal.II/source/meshworker/CMakeLists.txt | 24 +++++++++++++++++++ deal.II/source/multigrid/CMakeLists.txt | 12 ++++++---- deal.II/source/numerics/CMakeLists.txt | 12 ++++++---- 15 files changed, 171 insertions(+), 34 deletions(-) create mode 100644 deal.II/source/algorithms/CMakeLists.txt create mode 100644 deal.II/source/integrators/CMakeLists.txt create mode 100644 deal.II/source/matrix_free/CMakeLists.txt create mode 100644 deal.II/source/meshworker/CMakeLists.txt diff --git a/deal.II/cmake/macros/macro_deal_ii_add_library.cmake b/deal.II/cmake/macros/macro_deal_ii_add_library.cmake index e4b3fce705..a86d4dba44 100644 --- a/deal.II/cmake/macros/macro_deal_ii_add_library.cmake +++ b/deal.II/cmake/macros/macro_deal_ii_add_library.cmake @@ -40,6 +40,7 @@ MACRO(DEAL_II_ADD_LIBRARY _library) LINK_FLAGS "${DEAL_II_SHARED_LINKER_FLAGS_${_build}}" COMPILE_DEFINITIONS "${DEAL_II_DEFINITIONS};${DEAL_II_DEFINITIONS_${_build}}" COMPILE_FLAGS "${DEAL_II_CXX_FLAGS_${_build}}" + LINKER_LANGUAGE "CXX" ) FILE(APPEND diff --git a/deal.II/source/CMakeLists.txt b/deal.II/source/CMakeLists.txt index 0e0b4b045c..56b2dd0c1d 100644 --- a/deal.II/source/CMakeLists.txt +++ b/deal.II/source/CMakeLists.txt @@ -43,6 +43,8 @@ ADD_SUBDIRECTORY(hp) ADD_SUBDIRECTORY(multigrid) ADD_SUBDIRECTORY(distributed) +ADD_SUBDIRECTORY(algorithms) + FOREACH(build ${DEAL_II_BUILD_TYPES}) STRING(TOLOWER ${build} build_lowercase) diff --git a/deal.II/source/algorithms/CMakeLists.txt b/deal.II/source/algorithms/CMakeLists.txt new file mode 100644 index 0000000000..15a95c83b2 --- /dev/null +++ b/deal.II/source/algorithms/CMakeLists.txt @@ -0,0 +1,24 @@ +##### +## +## Copyright (C) 2013 by the deal.II authors +## +## This file is part of the deal.II library. +## +## +## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later +## version of the LGPL license. +## +## Author: Matthias Maier +## +##### + +INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) + +FILE(GLOB _header + ${CMAKE_SOURCE_DIR}/include/deal.II/algorithms/*.h + ) + +SET(_src + ) + +DEAL_II_ADD_LIBRARY(obj_algorithms OBJECT ${_src} ${_header}) diff --git a/deal.II/source/base/CMakeLists.txt b/deal.II/source/base/CMakeLists.txt index 991c7e9557..3eb89bfc66 100644 --- a/deal.II/source/base/CMakeLists.txt +++ b/deal.II/source/base/CMakeLists.txt @@ -14,7 +14,11 @@ INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(src_base +FILE(GLOB _header + ${CMAKE_SOURCE_DIR}/include/deal.II/base/*.h + ) + +SET(_src auto_derivative_function.cc conditional_ostream.cc config.cc @@ -64,5 +68,7 @@ SET(src_base utilities.cc ) -DEAL_II_ADD_LIBRARY(obj_base OBJECT ${src_base}) +DEAL_II_ADD_LIBRARY(obj_base OBJECT ${_src} ${_header} + ${CMAKE_BINARY_DIR}/include/deal.II/base/config.h + ) diff --git a/deal.II/source/distributed/CMakeLists.txt b/deal.II/source/distributed/CMakeLists.txt index 7ecc116e12..3334e88d9a 100644 --- a/deal.II/source/distributed/CMakeLists.txt +++ b/deal.II/source/distributed/CMakeLists.txt @@ -14,18 +14,22 @@ INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(src +FILE(GLOB _header + ${CMAKE_SOURCE_DIR}/include/deal.II/distributed/*.h + ) + +SET(_src grid_refinement.cc solution_transfer.cc tria.cc ) -SET(inst_in_files +SET(_inst grid_refinement.inst.in solution_transfer.inst.in tria.inst.in ) -DEAL_II_ADD_LIBRARY(obj_distributed OBJECT ${src}) -EXPAND_INSTANTIATIONS(obj_distributed "${inst_in_files}") +DEAL_II_ADD_LIBRARY(obj_distributed OBJECT ${_src} ${_header} ${_inst}) +EXPAND_INSTANTIATIONS(obj_distributed "${_inst}") diff --git a/deal.II/source/dofs/CMakeLists.txt b/deal.II/source/dofs/CMakeLists.txt index a730ecb982..c85db4f35c 100644 --- a/deal.II/source/dofs/CMakeLists.txt +++ b/deal.II/source/dofs/CMakeLists.txt @@ -14,7 +14,11 @@ INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(src +FILE(GLOB _header + ${CMAKE_SOURCE_DIR}/include/deal.II/dofs/*.h + ) + +SET(_src block_info.cc dof_accessor.cc dof_faces.cc @@ -26,7 +30,7 @@ SET(src number_cache.cc ) -SET(inst_in_files +SET(_inst block_info.inst.in dof_accessor.inst.in dof_handler.inst.in @@ -36,6 +40,6 @@ SET(inst_in_files dof_tools.inst.in ) -DEAL_II_ADD_LIBRARY(obj_dofs OBJECT ${src}) -EXPAND_INSTANTIATIONS(obj_dofs "${inst_in_files}") +DEAL_II_ADD_LIBRARY(obj_dofs OBJECT ${_src} ${_header} ${_inst}) +EXPAND_INSTANTIATIONS(obj_dofs "${_inst}") diff --git a/deal.II/source/fe/CMakeLists.txt b/deal.II/source/fe/CMakeLists.txt index 4d2ec0ff8f..5ee58d523b 100644 --- a/deal.II/source/fe/CMakeLists.txt +++ b/deal.II/source/fe/CMakeLists.txt @@ -14,7 +14,11 @@ INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(src +FILE(GLOB _header + ${CMAKE_SOURCE_DIR}/include/deal.II/fe/*.h + ) + +SET(_src block_mask.cc component_mask.cc fe_abf.cc @@ -49,7 +53,7 @@ SET(src mapping_q_eulerian.cc ) -SET(inst_in_files +SET(_inst fe_abf.inst.in fe_bdm.inst.in fe_dgp.inst.in @@ -84,6 +88,6 @@ SET(inst_in_files mapping_q.inst.in ) -DEAL_II_ADD_LIBRARY(obj_fe OBJECT ${src}) -EXPAND_INSTANTIATIONS(obj_fe "${inst_in_files}") +DEAL_II_ADD_LIBRARY(obj_fe OBJECT ${_src} ${_header} ${_inst}) +EXPAND_INSTANTIATIONS(obj_fe "${_inst}") diff --git a/deal.II/source/grid/CMakeLists.txt b/deal.II/source/grid/CMakeLists.txt index 91e5d3a889..bd92b3debb 100644 --- a/deal.II/source/grid/CMakeLists.txt +++ b/deal.II/source/grid/CMakeLists.txt @@ -14,7 +14,11 @@ INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(src +FILE(GLOB _header + ${CMAKE_SOURCE_DIR}/include/deal.II/grid/*.h + ) + +SET(_src grid_generator.cc grid_in.cc grid_out.cc @@ -32,7 +36,7 @@ SET(src tria_objects.cc ) -SET(inst_in_files +SET(_inst grid_generator.inst.in grid_in.inst.in grid_out.inst.in @@ -46,6 +50,6 @@ SET(inst_in_files tria_objects.inst.in ) -DEAL_II_ADD_LIBRARY(obj_grid OBJECT ${src}) -EXPAND_INSTANTIATIONS(obj_grid "${inst_in_files}") +DEAL_II_ADD_LIBRARY(obj_grid OBJECT ${_src} ${_header} ${_inst}) +EXPAND_INSTANTIATIONS(obj_grid "${_inst}") diff --git a/deal.II/source/hp/CMakeLists.txt b/deal.II/source/hp/CMakeLists.txt index c16ccb2834..cc6d712816 100644 --- a/deal.II/source/hp/CMakeLists.txt +++ b/deal.II/source/hp/CMakeLists.txt @@ -14,7 +14,11 @@ INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(src +FILE(GLOB _header + ${CMAKE_SOURCE_DIR}/include/deal.II/hp/*.h + ) + +SET(_src dof_faces.cc dof_handler.cc dof_levels.cc @@ -24,13 +28,13 @@ SET(src mapping_collection.cc ) -SET(inst_in_files +SET(_inst dof_handler.inst.in fe_collection.inst.in fe_values.inst.in mapping_collection.inst.in ) -DEAL_II_ADD_LIBRARY(obj_hp OBJECT ${src}) -EXPAND_INSTANTIATIONS(obj_hp "${inst_in_files}") +DEAL_II_ADD_LIBRARY(obj_hp OBJECT ${_src} ${_header} ${_inst}) +EXPAND_INSTANTIATIONS(obj_hp "${_inst}") diff --git a/deal.II/source/integrators/CMakeLists.txt b/deal.II/source/integrators/CMakeLists.txt new file mode 100644 index 0000000000..1f2ef00f97 --- /dev/null +++ b/deal.II/source/integrators/CMakeLists.txt @@ -0,0 +1,24 @@ +##### +## +## Copyright (C) 2013 by the deal.II authors +## +## This file is part of the deal.II library. +## +## +## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later +## version of the LGPL license. +## +## Author: Matthias Maier +## +##### + +INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) + +FILE(GLOB _header + ${CMAKE_SOURCE_DIR}/include/deal.II/integrators/*.h + ) + +SET(_src + ) + +DEAL_II_ADD_LIBRARY(obj_integrators OBJECT ${_src} ${_header}) diff --git a/deal.II/source/lac/CMakeLists.txt b/deal.II/source/lac/CMakeLists.txt index 4c872f34b1..14f27af4f7 100644 --- a/deal.II/source/lac/CMakeLists.txt +++ b/deal.II/source/lac/CMakeLists.txt @@ -14,7 +14,11 @@ INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(src +FILE(GLOB _header + ${CMAKE_SOURCE_DIR}/include/deal.II/lac/*.h + ) + +SET(_src block_matrix_array.cc block_sparse_matrix.cc block_sparse_matrix_ez.cc @@ -77,7 +81,7 @@ SET(src vector_view.cc ) -SET(inst_in_files +SET(_inst block_sparse_matrix.inst.in block_vector.inst.in chunk_sparse_matrix.inst.in @@ -98,6 +102,6 @@ SET(inst_in_files vector_view.inst.in ) -DEAL_II_ADD_LIBRARY(obj_lac OBJECT ${src}) -EXPAND_INSTANTIATIONS(obj_lac "${inst_in_files}") +DEAL_II_ADD_LIBRARY(obj_lac OBJECT ${_src} ${_header} ${_inst}) +EXPAND_INSTANTIATIONS(obj_lac "${_inst}") diff --git a/deal.II/source/matrix_free/CMakeLists.txt b/deal.II/source/matrix_free/CMakeLists.txt new file mode 100644 index 0000000000..87b061c814 --- /dev/null +++ b/deal.II/source/matrix_free/CMakeLists.txt @@ -0,0 +1,24 @@ +##### +## +## Copyright (C) 2013 by the deal.II authors +## +## This file is part of the deal.II library. +## +## +## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later +## version of the LGPL license. +## +## Author: Matthias Maier +## +##### + +INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) + +FILE(GLOB _header + ${CMAKE_SOURCE_DIR}/include/deal.II/matrix_free/*.h + ) + +SET(_src + ) + +DEAL_II_ADD_LIBRARY(obj_matrix_free OBJECT ${_src} ${_header}) diff --git a/deal.II/source/meshworker/CMakeLists.txt b/deal.II/source/meshworker/CMakeLists.txt new file mode 100644 index 0000000000..85ff52b6c4 --- /dev/null +++ b/deal.II/source/meshworker/CMakeLists.txt @@ -0,0 +1,24 @@ +##### +## +## Copyright (C) 2013 by the deal.II authors +## +## This file is part of the deal.II library. +## +## +## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later +## version of the LGPL license. +## +## Author: Matthias Maier +## +##### + +INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) + +FILE(GLOB _header + ${CMAKE_SOURCE_DIR}/include/deal.II/mesh_worker/*.h + ) + +SET(_src + ) + +DEAL_II_ADD_LIBRARY(obj_mesh_worker OBJECT ${_src} ${_header}) diff --git a/deal.II/source/multigrid/CMakeLists.txt b/deal.II/source/multigrid/CMakeLists.txt index cbe2e7d6c2..27c0307d6f 100644 --- a/deal.II/source/multigrid/CMakeLists.txt +++ b/deal.II/source/multigrid/CMakeLists.txt @@ -14,7 +14,11 @@ INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(src +FILE(GLOB _header + ${CMAKE_SOURCE_DIR}/include/deal.II/multigrid/*.h + ) + +SET(_src mg_base.cc mg_dof_handler.cc mg_tools.cc @@ -24,7 +28,7 @@ SET(src multigrid.cc ) -SET(inst_in_files +SET(_inst mg_base.inst.in mg_dof_handler.inst.in mg_tools.inst.in @@ -34,5 +38,5 @@ SET(inst_in_files multigrid.inst.in ) -DEAL_II_ADD_LIBRARY(obj_multigrid OBJECT ${src}) -EXPAND_INSTANTIATIONS(obj_multigrid "${inst_in_files}") +DEAL_II_ADD_LIBRARY(obj_multigrid OBJECT ${_src} ${_header} ${_inst}) +EXPAND_INSTANTIATIONS(obj_multigrid "${_inst}") diff --git a/deal.II/source/numerics/CMakeLists.txt b/deal.II/source/numerics/CMakeLists.txt index 08cb80e927..bd75841e6c 100644 --- a/deal.II/source/numerics/CMakeLists.txt +++ b/deal.II/source/numerics/CMakeLists.txt @@ -14,7 +14,11 @@ INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(src +FILE(GLOB _header + ${CMAKE_SOURCE_DIR}/include/deal.II/numerics/*.h + ) + +SET(_src data_out.cc data_out_faces.cc data_out_rotation.cc @@ -37,7 +41,7 @@ SET(src vector_tools.cc ) -SET(inst_in_files +SET(_inst data_out_faces.inst.in data_out.inst.in data_out_rotation.inst.in @@ -57,6 +61,6 @@ SET(inst_in_files vector_tools.inst.in ) -DEAL_II_ADD_LIBRARY(obj_numerics OBJECT ${src}) -EXPAND_INSTANTIATIONS(obj_numerics "${inst_in_files}") +DEAL_II_ADD_LIBRARY(obj_numerics OBJECT ${_src} ${_header} ${_inst}) +EXPAND_INSTANTIATIONS(obj_numerics "${_inst}") -- 2.39.5