Skip to content

Commit

Permalink
Remove endfunction(<string>) and endmacro(<string>) (TriBITSPub#274, T…
Browse files Browse the repository at this point in the history
…riBITSPub#382)

This is a follow-on from the lower-casing in TriBITSPub#274 with PR TriBITSPub#379.  It
lower-cased the function and macro names at the opening macro(<name> ...) and
function(<name> ...) but not the endmacro(<name> ...) and endfunction(<name>
...) calls.  (I did not realize the TriBITS had any of those still.)  Turns
out that when the text in the opening macro(<text>) and function(<text>) does
not exactly match the endmacro(<text>) and endfunction(<text>), you get a
nasty warning message:

  A logical block opening on the line ... closes on the line ... with
  mis-matching arguments.

(see TriBITSPub#382).

The TriBITS test suite does not actually run any of this code so this was
never seen prior to the creation of TriBITSPub#382.  Therefore, I don't know that this
solves the problem but I strongly suspect that it will.  (I will run a test
with an ATDM Trilinos build that should trigger this code.)
  • Loading branch information
bartlettroscoe committed Jun 23, 2021
1 parent efc76a7 commit 4bfd47b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
18 changes: 9 additions & 9 deletions tribits/common_tpls/find_modules/FindHDF5.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ macro(_hdf5_boolean_convert _var)
else()
set(${_var} FALSE)
endif()
endmacro(_HDF5_BOOLEAN_CONVERT)
endmacro()



Expand All @@ -87,7 +87,7 @@ function(_hdf5_chomp_string old_str new_str_var)

set(${new_str_var} ${_tmp} PARENT_SCOPE)

endfunction(_HDF5_CHOMP_STRING)
endfunction()



Expand Down Expand Up @@ -115,7 +115,7 @@ function(_hdf5_parse_settings_file _file _key _value)

set(${_value} ${_tmp} PARENT_SCOPE)

endfunction(_HDF5_PARSE_SETTINGS_FILE)
endfunction()



Expand All @@ -126,7 +126,7 @@ function(_hdf5_define_version _file _var)

set(${_var} ${_tmp} PARENT_SCOPE)

endfunction(_HDF5_DEFINE_VERSION _var)
endfunction()



Expand All @@ -138,7 +138,7 @@ function(_hdf5_define_parallel_build _file _var)

set(${_var} ${_tmp} PARENT_SCOPE)

endfunction(_HDF5_DEFINE_PARALLEL_BUILD _file _var)
endfunction()



Expand Down Expand Up @@ -171,7 +171,7 @@ function(_hdf5_extra_library_dirs _file _var)
endif()
set(${_var} ${_directories} PARENT_SCOPE)

endfunction(_HDF5_EXTRA_LIBRARY_DIRS _file _var)
endfunction()

function(_hdf5_library_path _file _var)

Expand All @@ -181,7 +181,7 @@ function(_hdf5_library_path _file _var)
_hdf5_parse_settings_file(${_file} ${_search_key} _tmp)

set(${_var} ${_tmp} PARENT_SCOPE)
endfunction(_HDF5_LIBRARY_PATH _file _var)
endfunction()



Expand Down Expand Up @@ -231,7 +231,7 @@ function(_hdf5_extra_libraries _file _var)

set(${_var} ${_return_list} PARENT_SCOPE)

endfunction(_HDF5_EXTRA_LIBRARIES _file _var)
endfunction()



Expand Down Expand Up @@ -275,7 +275,7 @@ function(_hdf5_extra_include_dirs _file _var)
endif()
set(${_var} ${_directories} PARENT_SCOPE)

endfunction(_HDF5_EXTRA_INCLUDE_DIRS _file _var)
endfunction()

#
# End Functions/Macros
Expand Down
2 changes: 1 addition & 1 deletion tribits/common_tpls/utils/AddImportedLibrary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,5 @@ function(add_imported_library target_name)
endif()

endif()
endfunction(ADD_IMPORTED_LIBRARY)
endfunction()

4 changes: 2 additions & 2 deletions tribits/common_tpls/utils/AddPackageDependency.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function(add_package_dependency)
macro(_print_usage)
message("\nadd_package_dependency(<target_package> DEPENDS_ON <req_package>)\n"
" Add req_package to target_package dependencies.\n")
endmacro(_print_usage)
endmacro()

# Parse the arguments
set(_options "")
Expand Down Expand Up @@ -172,4 +172,4 @@ function(add_package_dependency)

endif()

endfunction(ADD_PACKAGE_DEPENDENCY)
endfunction()

0 comments on commit 4bfd47b

Please sign in to comment.