From 8c7f0b563e5c8245aebd775eb569bc0e01cfce8a Mon Sep 17 00:00:00 2001 From: maier Date: Wed, 26 Sep 2012 09:08:14 +0000 Subject: [PATCH] Add a bunch of comments git-svn-id: https://svn.dealii.org/branches/branch_cmake@26748 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/cmake/macros/macro_add_flags.cmake | 4 ++-- .../macros/macro_check_cxx_compiler_bug.cmake | 4 ++-- deal.II/cmake/macros/macro_cond_set_to_yes.cmake | 4 ++-- deal.II/cmake/macros/macro_configure_feature.cmake | 11 +++++------ .../cmake/macros/macro_deal_ii_add_c_library.cmake | 3 +-- .../macros/macro_deal_ii_add_definitions.cmake | 5 +++-- .../cmake/macros/macro_deal_ii_add_library.cmake | 14 ++++++++++++-- .../cmake/macros/macro_enable_if_supported.cmake | 4 ++-- .../cmake/macros/macro_expand_instantiations.cmake | 9 +++++---- deal.II/cmake/macros/macro_set_if_empty.cmake | 4 +++- deal.II/cmake/macros/macro_strip_flag.cmake | 10 +++------- deal.II/cmake/macros/macro_to_string.cmake | 1 - .../macros/macro_to_string_and_add_prefix.cmake | 1 - 13 files changed, 40 insertions(+), 34 deletions(-) diff --git a/deal.II/cmake/macros/macro_add_flags.cmake b/deal.II/cmake/macros/macro_add_flags.cmake index 2a84224afe..d35338ee9b 100644 --- a/deal.II/cmake/macros/macro_add_flags.cmake +++ b/deal.II/cmake/macros/macro_add_flags.cmake @@ -1,6 +1,6 @@ # -# 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) diff --git a/deal.II/cmake/macros/macro_check_cxx_compiler_bug.cmake b/deal.II/cmake/macros/macro_check_cxx_compiler_bug.cmake index d69350adc8..da4631c815 100644 --- a/deal.II/cmake/macros/macro_check_cxx_compiler_bug.cmake +++ b/deal.II/cmake/macros/macro_check_cxx_compiler_bug.cmake @@ -2,10 +2,10 @@ # 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.) # diff --git a/deal.II/cmake/macros/macro_cond_set_to_yes.cmake b/deal.II/cmake/macros/macro_cond_set_to_yes.cmake index 55dcd8346a..ded704afa5 100644 --- a/deal.II/cmake/macros/macro_cond_set_to_yes.cmake +++ b/deal.II/cmake/macros/macro_cond_set_to_yes.cmake @@ -1,6 +1,6 @@ - # -# 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) diff --git a/deal.II/cmake/macros/macro_configure_feature.cmake b/deal.II/cmake/macros/macro_configure_feature.cmake index 87b465e6a1..e41eb63aa1 100644 --- a/deal.II/cmake/macros/macro_configure_feature.cmake +++ b/deal.II/cmake/macros/macro_configure_feature.cmake @@ -8,11 +8,11 @@ # 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 @@ -38,7 +38,6 @@ # 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. diff --git a/deal.II/cmake/macros/macro_deal_ii_add_c_library.cmake b/deal.II/cmake/macros/macro_deal_ii_add_c_library.cmake index 7200ca3931..1e5166230f 100644 --- a/deal.II/cmake/macros/macro_deal_ii_add_c_library.cmake +++ b/deal.II/cmake/macros/macro_deal_ii_add_c_library.cmake @@ -1,6 +1,5 @@ - # -# TODO: A comment +# See macro_deal_ii_add_library.cmake for an explanation of this macro # MACRO(DEAL_II_ADD_C_LIBRARY library) diff --git a/deal.II/cmake/macros/macro_deal_ii_add_definitions.cmake b/deal.II/cmake/macros/macro_deal_ii_add_definitions.cmake index d99e9c8e86..cba2b82152 100644 --- a/deal.II/cmake/macros/macro_deal_ii_add_definitions.cmake +++ b/deal.II/cmake/macros/macro_deal_ii_add_definitions.cmake @@ -1,6 +1,7 @@ - # -# 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) 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 297ce5bf4e..3f1758025e 100644 --- a/deal.II/cmake/macros/macro_deal_ii_add_library.cmake +++ b/deal.II/cmake/macros/macro_deal_ii_add_library.cmake @@ -1,6 +1,16 @@ - # -# 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) diff --git a/deal.II/cmake/macros/macro_enable_if_supported.cmake b/deal.II/cmake/macros/macro_enable_if_supported.cmake index c936958d88..8431652f6b 100644 --- a/deal.II/cmake/macros/macro_enable_if_supported.cmake +++ b/deal.II/cmake/macros/macro_enable_if_supported.cmake @@ -1,6 +1,6 @@ # -# 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) diff --git a/deal.II/cmake/macros/macro_expand_instantiations.cmake b/deal.II/cmake/macros/macro_expand_instantiations.cmake index f923b0d8c4..7fd48d1cbe 100644 --- a/deal.II/cmake/macros/macro_expand_instantiations.cmake +++ b/deal.II/cmake/macros/macro_expand_instantiations.cmake @@ -8,8 +8,9 @@ # # 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 # @@ -40,8 +41,8 @@ MACRO(EXPAND_INSTANTIATIONS target 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) diff --git a/deal.II/cmake/macros/macro_set_if_empty.cmake b/deal.II/cmake/macros/macro_set_if_empty.cmake index bb24d65357..6d530f1d7b 100644 --- a/deal.II/cmake/macros/macro_set_if_empty.cmake +++ b/deal.II/cmake/macros/macro_set_if_empty.cmake @@ -1,4 +1,6 @@ - +# +# If 'variable' is empty it will be set to 'value' +# MACRO(SET_IF_EMPTY variable value) IF("${${variable}}" STREQUAL "") SET(${variable} ${value}) diff --git a/deal.II/cmake/macros/macro_strip_flag.cmake b/deal.II/cmake/macros/macro_strip_flag.cmake index bbf571e48b..9aa458f380 100644 --- a/deal.II/cmake/macros/macro_strip_flag.cmake +++ b/deal.II/cmake/macros/macro_strip_flag.cmake @@ -6,12 +6,8 @@ # 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() diff --git a/deal.II/cmake/macros/macro_to_string.cmake b/deal.II/cmake/macros/macro_to_string.cmake index 7bdb48c68c..886908c06a 100644 --- a/deal.II/cmake/macros/macro_to_string.cmake +++ b/deal.II/cmake/macros/macro_to_string.cmake @@ -1,4 +1,3 @@ - # # A small macro used for converting a list into a space # separated string: diff --git a/deal.II/cmake/macros/macro_to_string_and_add_prefix.cmake b/deal.II/cmake/macros/macro_to_string_and_add_prefix.cmake index 7df7da7bbd..e1c11e0287 100644 --- a/deal.II/cmake/macros/macro_to_string_and_add_prefix.cmake +++ b/deal.II/cmake/macros/macro_to_string_and_add_prefix.cmake @@ -1,4 +1,3 @@ - # # A small macro used for converting a cmake list into a space # separated string. This macro adds the string "prefix" in front of each -- 2.39.5