#
-# A small macro used for (string-)appending a string flags to a
-# string variable
+# A small macro used for (string-)appending a string "${flags}" to a
+# string "${variable}"
#
# Usage:
# ADD_FLAGS(variable flags)
# Check for a compiler bug.
#
# Usage:
-# CHECK_CXX_COMPILER_BUG(source var)
+# CHECK_CXX_COMPILER_BUG(source var),
#
# where source is a snipped of source code and var is a variable that will
-# be set to true if source could not be compiled and linked successfully.
+# be set to true if the source could not be compiled and linked successfully.
# (This just inverts the logic of CHECK_CXX_SOURCE_COMPILES.)
#
-
#
-# IF(bool), set variable to "yes".
+# If bool is "true" (in a cmake fashion...), set variable to "yes",
+# otherwise to "no".
#
# Usage:
# COND_SET_TO_YES(bool variable)
# For a feature ${feature} (written in all caps) the following options,
# variables and macros have to be defined (except marked as optional):
#
-# DEAL_II_WITH_${feature} (option, mandatory)
-# determines whether the feature will be configured, if
-# DEAL_II_FEATURE_AUTODETECTION is OFF. If
-# DEAL_II_FEATURE_AUTODETECTION is ON, this option will be set if
-# configuring the feature was successful.
+# DEAL_II_WITH_${feature} (bool, mandatory)
+# If DEAL_II_FEATURE_AUTODETECTION is OFF, this boolean determines
+# whether the feature will be configured.
+# If DEAL_II_FEATURE_AUTODETECTION is ON, this boolean will
+# automatically be set if configuring the feature was successful.
#
# FEATURE_${feature}_DEPENDS (variable, optional)
# a variable which contains an optional list of other features
# This macro should give an error (SEND_ERROR or FATAL_ERROR).
#
# FEATURE_${feature}_CONFIGURE_EXTERNAL(var) (macro, mandatory)
-#
# which should setup all necessary configuration for the feature with
# external dependencies. var set to TRUE indicates success,
# otherwise this script gives an error.
-
#
-# TODO: A comment
+# See macro_deal_ii_add_library.cmake for an explanation of this macro
#
MACRO(DEAL_II_ADD_C_LIBRARY library)
-
#
-# TODO: A comment
+# A small wrapper around
+# SET_TARGET_PROPERTY(... PROPERTIES COMPILE_DEFINITIONS ...)
+# to _add_ compile definitions to every target we have specified.
#
MACRO(DEAL_II_ADD_DEFINITIONS name)
-
#
-# TODO: A comment
+# A small wrapper around ADD_LIBRARY that will define a target for each
+# build type specified in DEAL_II_BUILD_TYPES
+#
+# It is assumed that the desired compilation configuration is set via
+# DEAL_II_SHARED_LINKER_FLAGS_${build}
+# DEAL_II_CXX_FLAGS_${build}
+# DEAL_II_DEFINITIONS_${build}
+#
+# as well as the global (for all build types)
+# CMAKE_SHARED_LINKER_FLAGS
+# CMAKE_CXX_FLAGS
+# DEAL_II_DEFINITIONS
#
MACRO(DEAL_II_ADD_LIBRARY library)
#
-# Tests whether the cxx compiler understands flag. If so, add it to
-# variable.
+# Tests whether the cxx compiler understands a flag.
+# If so, add it to 'variable'.
#
# Usage:
# ENABLE_IF_SUPPORTED(variable flag)
#
# target
#
-# a target that will depend on the generation of all .inst files.
-# (To ensure that all .inst files are generated prior to compiling.)
+# where target.${build_type} will depend on the generation of all .inst
+# files, to ensure that all .inst files are generated prior to
+# compiling.
#
# inst_in_files
#
ADD_CUSTOM_TARGET(${target}.inst ALL DEPENDS ${inst_targets})
#
- # Add a dependency to target so that target.inst is fully generated
- # before target will be processed.
+ # Add a dependency to all target.${build_type} so that target.inst is
+ # fully generated before target will be processed.
#
FOREACH(build ${DEAL_II_BUILD_TYPES})
STRING(TOLOWER ${build} build_lowercase)
-
+#
+# If 'variable' is empty it will be set to 'value'
+#
MACRO(SET_IF_EMPTY variable value)
IF("${${variable}}" STREQUAL "")
SET(${variable} ${value})
#
MACRO(STRIP_FLAG variable flag)
- IF(NOT "${variable}" STREQUAL "")
- SET(${variable} " ${${variable}}")
- STRING(REPLACE " ${flag}" "" ${variable} ${${variable}})
- IF(NOT "${variable}" STREQUAL "")
- STRING(STRIP ${${variable}} ${variable})
- ENDIF()
- ENDIF()
+ SET(${variable} " ${${variable}}")
+ STRING(REPLACE " ${flag}" "" "${variable}" ${${variable}})
+ STRING(STRIP "${${variable}}" ${variable})
ENDMACRO()
-
#
# A small macro used for converting a list into a space
# separated string:
-
#
# A small macro used for converting a cmake list into a space
# separated string. This macro adds the string "prefix" in front of each