## ---------------------------------------------------------------------
##
-## Copyright (C) 2012 - 2018 by the deal.II authors
+## Copyright (C) 2012 - 2022 by the deal.II authors
##
## This file is part of the deal.II library.
##
foreach(_build ${DEAL_II_BUILD_TYPES})
string(TOLOWER ${_build} _build_lowercase)
+ set(_target "${_library}_${_build_lowercase}")
- add_library(${_library}_${_build_lowercase} ${ARGN})
+ add_library(${_target} ${ARGN})
- set_target_properties(${_library}_${_build_lowercase} PROPERTIES
- LINKER_LANGUAGE "CXX"
- )
+ #
+ # Add standard properties defined in DEAL_II_* variables:
+ #
- target_link_libraries(${_library}_${_build_lowercase}
- PUBLIC ${DEAL_II_TARGETS} ${DEAL_II_TARGETS_${_build}}
- )
+ populate_target_properties(${_target} ${_build})
if("${_library}" MATCHES "^bundled_")
#
# Record all bundled object libraries in the global property
# DEAL_II_BUNDLED_TARGETS_${_build}
#
- set_property(GLOBAL APPEND PROPERTY DEAL_II_BUNDLED_TARGETS_${_build}
- ${_library}_${_build_lowercase}
- )
+ set_property(GLOBAL APPEND PROPERTY DEAL_II_BUNDLED_TARGETS_${_build} ${_target})
else()
get_property(_bundled_object_targets
GLOBAL PROPERTY DEAL_II_BUNDLED_TARGETS_${build}
)
- target_link_libraries(${_library}_${_build_lowercase}
- PRIVATE ${_bundled_object_targets}
- )
+ target_link_libraries(${_target} PRIVATE ${_bundled_object_targets})
endif()
- set_property(GLOBAL APPEND PROPERTY DEAL_II_OBJECT_TARGETS_${_build}
- ${_library}_${_build_lowercase}
- )
+ set_property(GLOBAL APPEND PROPERTY DEAL_II_OBJECT_TARGETS_${_build} ${_target})
endforeach()
endfunction()
--- /dev/null
+## ---------------------------------------------------------------------
+##
+## Copyright (C) 2022 - 2022 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE.md at
+## the top level directory of deal.II.
+##
+## ---------------------------------------------------------------------
+
+#
+# populate_target_properties(<target> <build>)
+#
+# This function populate target properties according to (globally) defined
+# DEAL_II_* variables. Specifically:
+#
+# DEAL_II_LIBRARIES DEAL_II_LIBRARIES_<build>
+# DEAL_II_TARGETS DEAL_II_TARGETS_<build>
+# - populating the LINK_LIBRARIES target property
+# DEAL_II_INCLUDE_DIRS
+# - populating the INCLUDE_DIRECTORIES target property
+# DEAL_II_DEFINITIONS DEAL_II_DEFINITIONS_<build>
+# - populating the COMPILE_DEFINITIONS target property
+# DEAL_II_CXX_FLAGS DEAL_II_CXX_FLAGS_<build>
+# - populating the COMPILE_OPTIONS target property
+# DEAL_II_LINKER_FLAGS DEAL_II_LINKER_FLAGS_<build>
+# - populating the LINK_OPTIONS target property
+#
+# In addition the macro sets up a BUILD_INTERFACE and INSTALL_INTERFACE
+# includes
+#
+
+function(populate_target_properties _target _build)
+
+ set_target_properties(${_target} PROPERTIES LINKER_LANGUAGE "CXX")
+
+ target_link_libraries(${_target}
+ PUBLIC ${DEAL_II_LIBRARIES} ${DEAL_II_LIBRARIES_${_build}}
+ ${DEAL_II_TARGETS} ${DEAL_II_TARGETS_${_build}}
+ )
+
+ #
+ # Include the current source directory of any target as private include
+ # and add the contents of ${DEAL_II_INCLUDE_DIRS} as a public interface.
+ #
+ target_include_directories(${_target} BEFORE PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
+ target_include_directories(${_target} SYSTEM PUBLIC ${DEAL_II_INCLUDE_DIRS})
+
+ # Build directory specific includes:
+
+ target_include_directories(${_target} PRIVATE
+ ${CMAKE_BINARY_DIR}/include
+ ${CMAKE_SOURCE_DIR}/include
+ ${DEAL_II_BUNDLED_INCLUDE_DIRS}
+ )
+
+ # Interface includes:
+
+ set(_includes
+ $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>
+ $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
+ "$<INSTALL_INTERFACE:\${DEAL_II_INCLUDE_RELDIR}>"
+ )
+ foreach(_include ${DEAL_II_BUNDLED_INCLUDE_DIRS})
+ list(APPEND _includes $<BUILD_INTERFACE:${_include}>)
+ endforeach()
+ if(NOT "${DEAL_II_BUNDLED_INCLUDE_DIRS}" STREQUAL "")
+ list(APPEND _includes "$<INSTALL_INTERFACE:\${DEAL_II_INCLUDE_RELDIR}/deal.II/bundled>")
+ endif()
+
+ target_include_directories(${_target} INTERFACE ${_includes})
+
+ target_compile_definitions(${_target}
+ PUBLIC ${DEAL_II_DEFINITIONS} ${DEAL_II_DEFINITIONS_${_build}}
+ )
+
+ separate_arguments(_compile_options UNIX_COMMAND
+ "${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${_build}}"
+ )
+ target_compile_options(${_target}
+ PUBLIC $<$<COMPILE_LANGUAGE:CXX>:${_compile_options}>
+ )
+
+ separate_arguments(_link_options UNIX_COMMAND
+ "${DEAL_II_LINKER_FLAGS} ${DEAL_II_LINKER_FLAGS_${_build}}"
+ )
+ target_link_options(${_target} INTERFACE ${_link_options})
+
+endfunction()
--- /dev/null
+## ---------------------------------------------------------------------
+##
+## Copyright (C) 2022 - 2022 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE.md at
+## the top level directory of deal.II.
+##
+## ---------------------------------------------------------------------
+
+#
+# print_target_properties(<target> [variable])
+#
+# Prints all relevant information of the specified target.
+#
+
+function(print_target_properties _target)
+
+ if(NOT TARGET ${_target})
+ return()
+ endif()
+
+ set(_messages)
+ list(APPEND _messages "Target: ${_target}")
+
+ foreach(_property
+ TYPE
+ LINK_LIBRARIES INTERFACE_LINK_LIBRARIES
+ INCLUDE_DIRECTORIES INTERFACE_INCLUDE_DIRECTORIES
+ COMPILE_DEFINITIONS INTERFACE_COMPILE_DEFINITIONS
+ COMPILE_OPTIONS INTERFACE_COMPILE_OPTIONS
+ LINK_OPTIONS INTERFACE_LINK_OPTIONS
+ )
+ get_target_property(_value ${_target} ${_property})
+ if(NOT "${_value}" MATCHES "-NOTFOUND")
+ string(REPLACE ";" " " _value "${_value}")
+ list(APPEND _messages " ${_property}: ${_value}")
+ endif()
+ endforeach()
+
+ if("${ARGN}" STREQUAL "")
+ foreach(_message ${_messages})
+ message(STATUS "${_message}")
+ endforeach()
+ else()
+ set(${ARGN} "${_messages}" PARENT_SCOPE)
+ endif()
+endfunction()
+
+++ /dev/null
-## ---------------------------------------------------------------------
-##
-## Copyright (C) 2013 - 2015 by the deal.II authors
-##
-## This file is part of the deal.II library.
-##
-## The deal.II library is free software; you can use it, redistribute
-## it, and/or modify it under the terms of the GNU Lesser General
-## Public License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-## The full text of the license can be found in the file LICENSE.md at
-## the top level directory of deal.II.
-##
-## ---------------------------------------------------------------------
-
-#
-# This macro is used for the feature configuration in deal.II. It adds
-# individual FEATURE_* configuration variables to the corresponding
-# DEAL_II_* variables
-#
-# Usage:
-# register_feature(feature)
-#
-# This macro will add
-#
-# <FEATURE>_LIBRARIES (respecting general, optimized, debug keyword)
-#
-# and all other suffixes defined in DEAL_II_LIST_SUFFIXES and
-# DEAL_II_STRING_SUFFIXES to the corresponding DEAL_II_* variables
-#
-
-macro(register_feature _feature)
-
- if(DEFINED ${_feature}_LIBRARIES)
- #
- # Add ${_feature}_LIBRARIES to
- # DEAL_II_LIBRARIES
- # DEAL_II_LIBRARIES_DEBUG
- # DEAL_II_LIBRARIES_RELEASE
- # depending on the "optimized", "debug" or "general" keyword
- #
- set(_toggle "general")
- foreach(_tmp ${${_feature}_LIBRARIES})
- if( "${_tmp}" STREQUAL "debug" OR
- "${_tmp}" STREQUAL "optimized" OR
- "${_tmp}" STREQUAL "general" )
- set(_toggle "${_tmp}")
- else()
- if("${_toggle}" STREQUAL "general")
- list(APPEND DEAL_II_LIBRARIES ${_tmp})
- elseif("${_toggle}" STREQUAL "debug")
- list(APPEND DEAL_II_LIBRARIES_DEBUG ${_tmp})
- elseif("${_toggle}" STREQUAL "optimized")
- list(APPEND DEAL_II_LIBRARIES_RELEASE ${_tmp})
- endif()
- endif()
- endforeach()
- endif()
-
- foreach(_var ${DEAL_II_LIST_SUFFIXES})
- if(NOT "${_var}" STREQUAL "LIBRARIES" AND DEFINED ${_feature}_${_var})
- list(APPEND DEAL_II_${_var} ${${_feature}_${_var}})
- endif()
- endforeach()
-
- foreach(_var ${DEAL_II_STRING_SUFFIXES})
- if(DEFINED ${_feature}_${_var})
- add_flags(DEAL_II_${_var} "${${_feature}_${_var}}")
- endif()
- endforeach()
-
-endmacro()
_both("#\n")
_detailed(
-"# Base configuration (prior to feature configuration):
-# DEAL_II_CXX_FLAGS: ${BASE_CXX_FLAGS}
+"# Base configuration:
+# DEAL_II_CXX_FLAGS: ${DEAL_II_CXX_FLAGS}
"
)
if(CMAKE_BUILD_TYPE MATCHES "Release")
- _detailed("# DEAL_II_CXX_FLAGS_RELEASE: ${BASE_CXX_FLAGS_RELEASE}\n")
+ _detailed("# DEAL_II_CXX_FLAGS_RELEASE: ${DEAL_II_CXX_FLAGS_RELEASE}\n")
endif()
if(CMAKE_BUILD_TYPE MATCHES "Debug")
- _detailed("# DEAL_II_CXX_FLAGS_DEBUG: ${BASE_CXX_FLAGS_DEBUG}\n")
+ _detailed("# DEAL_II_CXX_FLAGS_DEBUG: ${DEAL_II_CXX_FLAGS_DEBUG}\n")
endif()
-_detailed("# DEAL_II_LINKER_FLAGS: ${BASE_LINKER_FLAGS}\n")
+_detailed("# DEAL_II_LINKER_FLAGS: ${DEAL_II_LINKER_FLAGS}\n")
if(CMAKE_BUILD_TYPE MATCHES "Release")
- _detailed("# DEAL_II_LINKER_FLAGS_RELEASE: ${BASE_LINKER_FLAGS_RELEASE}\n")
+ _detailed("# DEAL_II_LINKER_FLAGS_RELEASE: ${DEAL_II_LINKER_FLAGS_RELEASE}\n")
endif()
if(CMAKE_BUILD_TYPE MATCHES "Debug")
- _detailed("# DEAL_II_LINKER_FLAGS_DEBUG: ${BASE_LINKER_FLAGS_DEBUG}\n")
+ _detailed("# DEAL_II_LINKER_FLAGS_DEBUG: ${DEAL_II_LINKER_FLAGS_DEBUG}\n")
endif()
-_detailed("# DEAL_II_DEFINITIONS: ${BASE_DEFINITIONS}\n")
+_detailed("# DEAL_II_DEFINITIONS: ${DEAL_II_DEFINITIONS}\n")
if(CMAKE_BUILD_TYPE MATCHES "Release")
- _detailed("# DEAL_II_DEFINITIONS_RELEASE: ${BASE_DEFINITIONS_RELEASE}\n")
+ _detailed("# DEAL_II_DEFINITIONS_RELEASE: ${DEAL_II_DEFINITIONS_RELEASE}\n")
endif()
if(CMAKE_BUILD_TYPE MATCHES "Debug")
- _detailed("# DEAL_II_DEFINITIONS_DEBUG: ${BASE_DEFINITIONS_DEBUG}\n")
+ _detailed("# DEAL_II_DEFINITIONS_DEBUG: ${DEAL_II_DEFINITIONS_DEBUG}\n")
endif()
-_detailed("# DEAL_II_INCLUDE_DIRS ${BASE_INCLUDE_DIRS}\n")
-_detailed("# DEAL_II_BUNDLED_INCLUDE_DIRS: ${BASE_BUNDLED_INCLUDE_DIRS}\n")
+_detailed("# DEAL_II_INCLUDE_DIRS ${DEAL_II_INCLUDE_DIRS}\n")
-_detailed("# DEAL_II_LIBRARIES: ${BASE_LIBRARIES}\n")
+_detailed("# DEAL_II_LIBRARIES: ${DEAL_II_LIBRARIES}\n")
if(CMAKE_BUILD_TYPE MATCHES "Release")
- _detailed("# DEAL_II_LIBRARIES_RELEASE: ${BASE_LIBRARIES_RELEASE}\n")
+ _detailed("# DEAL_II_LIBRARIES_RELEASE: ${DEAL_II_LIBRARIES_RELEASE}\n")
endif()
if(CMAKE_BUILD_TYPE MATCHES "Debug")
- _detailed("# DEAL_II_LIBRARIES_DEBUG: ${BASE_LIBRARIES_DEBUG}\n")
+ _detailed("# DEAL_II_LIBRARIES_DEBUG: ${DEAL_II_LIBRARIES_DEBUG}\n")
endif()
+
+_detailed("# DEAL_II_TARGETS: ${DEAL_II_TARGETS}\n")
+if(CMAKE_BUILD_TYPE MATCHES "Release")
+ _detailed("# DEAL_II_TARGETS_RELEASE: ${DEAL_II_TARGETS_RELEASE}\n")
+endif()
+if(CMAKE_BUILD_TYPE MATCHES "Debug")
+ _detailed("# DEAL_II_TARGETS_DEBUG: ${DEAL_II_TARGETS_DEBUG}\n")
+endif()
+
_detailed("# DEAL_II_VECTORIZATION_WIDTH_IN_BITS: ${DEAL_II_VECTORIZATION_WIDTH_IN_BITS}\n")
if(DEAL_II_HAVE_CXX20)
# Compile the deal.II library
#
-include_directories(
- ${CMAKE_BINARY_DIR}/include/
- ${CMAKE_SOURCE_DIR}/include/
- ${DEAL_II_BUNDLED_INCLUDE_DIRS}
- SYSTEM
- ${DEAL_II_INCLUDE_DIRS}
- )
-
#
# List the directories where we have source files. the ones with the longest
# compile jobs come first so that 'make -j N' saturates many processors also
# end of everything (e.g. numerics/vectors.cc takes several minutes to
# compile...)
#
+set(CMAKE_INCLUDE_CURRENT_DIR true)
add_subdirectory(numerics)
add_subdirectory(fe)
add_subdirectory(dofs)
# Combine all ${build} OBJECT targets to a ${build} library:
#
- get_property(_objects GLOBAL PROPERTY DEAL_II_OBJECTS_${build})
+ add_library(${DEAL_II_NAMESPACE}_${build_lowercase} dummy.cc)
+ add_dependencies(library ${DEAL_II_NAMESPACE}_${build_lowercase})
- add_library(${DEAL_II_NAMESPACE}_${build_lowercase}
- dummy.cc # Workaround for a bug in the Xcode generator
- ${_objects}
+ #
+ # Add compile flags, definitions and (public) feature (recorded in
+ # DEAL_II_TARGETS(|_DEBUG|_RELEASE)).
+ #
+ populate_target_properties(${DEAL_II_NAMESPACE}_${build_lowercase} ${build})
+
+ #
+ # Add all object targets as private link targets
+ #
+ get_property(_object_targets GLOBAL PROPERTY DEAL_II_OBJECT_TARGETS_${build})
+ target_link_libraries(${DEAL_II_NAMESPACE}_${build_lowercase}
+ PRIVATE ${_object_targets}
)
- add_dependencies(library ${DEAL_II_NAMESPACE}_${build_lowercase})
set_target_properties(${DEAL_II_NAMESPACE}_${build_lowercase}
PROPERTIES
+ LINKER_LANGUAGE "CXX"
VERSION "${DEAL_II_PACKAGE_VERSION}"
#
# Sonaming: Well... we just use the version number.
# a C++ library is still ABI backwards compatible :-]
#
SOVERSION "${DEAL_II_PACKAGE_VERSION}"
- LINK_FLAGS "${DEAL_II_LINKER_FLAGS} ${DEAL_II_LINKER_FLAGS_${build}}"
- LINKER_LANGUAGE "CXX"
- COMPILE_DEFINITIONS "${DEAL_II_DEFINITIONS};${DEAL_II_DEFINITIONS_${build}}"
- COMPILE_FLAGS "${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${build}}"
ARCHIVE_OUTPUT_NAME "${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX}"
LIBRARY_OUTPUT_NAME "${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX}"
RUNTIME_OUTPUT_NAME "${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX}"
)
endif()
-
- target_link_libraries(${DEAL_II_NAMESPACE}_${build_lowercase}
- ${DEAL_II_LIBRARIES_${build}}
- ${DEAL_II_LIBRARIES}
- )
-
- file(MAKE_DIRECTORY
- ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}
- )
+ file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR})
export(TARGETS ${DEAL_II_NAMESPACE}_${build_lowercase}
NAMESPACE "${DEAL_II_NAMESPACE}::"
FILE ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Targets.cmake
##
## ---------------------------------------------------------------------
-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
-
set(_src
general_data_storage.cc
operator.cc
##
## ---------------------------------------------------------------------
-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
-
set(_src
access_traits.cc
)
##
## ---------------------------------------------------------------------
-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
-
#
# All source/base files are sufficiently small that they may be added to the
# unity build file (see the developer documentation on DEAL_II_UNITY_BUILD
##
## ---------------------------------------------------------------------
-
-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
-
-
set(_src
surface_mesh.cc
intersections.cc
)
-
-
set(_inst
surface_mesh.inst.in
intersections.inst.in
##
## ---------------------------------------------------------------------
-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
-
set(_src
ad_drivers.cc
ad_helpers.cc
##
## ---------------------------------------------------------------------
-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
-
set(_src
symengine_math.cc
symengine_number_types.cc
##
## ---------------------------------------------------------------------
-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
-
set(_unity_include_src
grid_refinement.cc
cell_weights.cc
##
## ---------------------------------------------------------------------
-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
-
set(_unity_include_src
block_info.cc
dof_faces.cc
##
## ---------------------------------------------------------------------
-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
-
set(_unity_include_src
block_mask.cc
component_mask.cc
##
## ---------------------------------------------------------------------
-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
-
set(_src
utilities.cc
)
##
## ---------------------------------------------------------------------
-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
-
#
# Work around an issue where gcc emits a note that the warning
# -Wmisleading-indentation will be disabled due to a humongous line of over
)
endif()
-
set(_unity_include_src
cell_id.cc
grid_refinement.cc
##
## ---------------------------------------------------------------------
-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
-
set(_unity_include_src
fe_collection.cc
fe_values.cc
##
## ---------------------------------------------------------------------
-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
-
set(_src
)
##
## ---------------------------------------------------------------------
-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
-
set(_unity_include_src
affine_constraints.cc
block_sparse_matrix.cc
##
## ---------------------------------------------------------------------
-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
-
set(_src
dof_info.cc
evaluation_template_factory.cc
##
## ---------------------------------------------------------------------
-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
-
set(_src
mesh_worker.cc
mesh_worker_info.cc
##
## ---------------------------------------------------------------------
-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
-
set(_unity_include_src
mg_base.cc
mg_level_global_transfer.cc
##
## ---------------------------------------------------------------------
-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
-
set(_src
fe_immersed_values.cc
fe_values.cc
##
## ---------------------------------------------------------------------
-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
-
set(_unity_include_src
data_out.cc
data_out_faces.cc
##
## ---------------------------------------------------------------------
-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
-
set(_src
utilities.cc
manifold_lib.cc
##
## ---------------------------------------------------------------------
-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
-
set(_src
)
##
## ---------------------------------------------------------------------
-
-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
-
set(_src
data_out.cc
particle.cc
# Expand instantiations in subdirectories
add_subdirectory("elasticity")
-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
-
set(_src
transformations.cc
)
##
## ---------------------------------------------------------------------
-
-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
-
set(_src
kinematics.cc
standard_tensors.cc
##
## ---------------------------------------------------------------------
-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
-
set(_src
arkode.cc
ida.cc