From e9ea581bfc818d17336fb7b520f96de8ceaf5d73 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Wed, 23 Jun 2021 09:01:41 -0600 Subject: [PATCH] Remove endfunction() and endmacro() (#274, #382) This is a follow-on from the lower-casing in #274 with PR #379. It lower-cased the function and macro names at the opening macro( ...) and function( ...) but not the endmacro( ...) and endfunction( ...) calls. (I did not realize the TriBITS had any of those still.) Turns out that when the text in the opening macro() and function() does not exactly match the endmacro() and endfunction(), you get a nasty warning message: A logical block opening on the line ... closes on the line ... with mis-matching arguments. (see #382). The TriBITS test suite does not actually run any of this code so this was never seen prior to the creation of #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.) --- .../common_tpls/find_modules/FindHDF5.cmake | 18 +++++++++--------- .../common_tpls/utils/AddImportedLibrary.cmake | 2 +- .../utils/AddPackageDependency.cmake | 4 ++-- .../common_tpls/utils/ParseLibraryList.cmake | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tribits/common_tpls/find_modules/FindHDF5.cmake b/tribits/common_tpls/find_modules/FindHDF5.cmake index ebc986104..410853ec6 100644 --- a/tribits/common_tpls/find_modules/FindHDF5.cmake +++ b/tribits/common_tpls/find_modules/FindHDF5.cmake @@ -73,7 +73,7 @@ macro(_hdf5_boolean_convert _var) else() set(${_var} FALSE) endif() -endmacro(_HDF5_BOOLEAN_CONVERT) +endmacro() @@ -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() @@ -115,7 +115,7 @@ function(_hdf5_parse_settings_file _file _key _value) set(${_value} ${_tmp} PARENT_SCOPE) -endfunction(_HDF5_PARSE_SETTINGS_FILE) +endfunction() @@ -126,7 +126,7 @@ function(_hdf5_define_version _file _var) set(${_var} ${_tmp} PARENT_SCOPE) -endfunction(_HDF5_DEFINE_VERSION _var) +endfunction() @@ -138,7 +138,7 @@ function(_hdf5_define_parallel_build _file _var) set(${_var} ${_tmp} PARENT_SCOPE) -endfunction(_HDF5_DEFINE_PARALLEL_BUILD _file _var) +endfunction() @@ -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) @@ -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() @@ -231,7 +231,7 @@ function(_hdf5_extra_libraries _file _var) set(${_var} ${_return_list} PARENT_SCOPE) -endfunction(_HDF5_EXTRA_LIBRARIES _file _var) +endfunction() @@ -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 diff --git a/tribits/common_tpls/utils/AddImportedLibrary.cmake b/tribits/common_tpls/utils/AddImportedLibrary.cmake index 911ffe821..2c6ce6694 100644 --- a/tribits/common_tpls/utils/AddImportedLibrary.cmake +++ b/tribits/common_tpls/utils/AddImportedLibrary.cmake @@ -111,5 +111,5 @@ function(add_imported_library target_name) endif() endif() -endfunction(ADD_IMPORTED_LIBRARY) +endfunction() diff --git a/tribits/common_tpls/utils/AddPackageDependency.cmake b/tribits/common_tpls/utils/AddPackageDependency.cmake index e573ef456..bb1784621 100644 --- a/tribits/common_tpls/utils/AddPackageDependency.cmake +++ b/tribits/common_tpls/utils/AddPackageDependency.cmake @@ -56,7 +56,7 @@ function(add_package_dependency) macro(_print_usage) message("\nadd_package_dependency( DEPENDS_ON )\n" " Add req_package to target_package dependencies.\n") - endmacro(_print_usage) + endmacro() # Parse the arguments set(_options "") @@ -172,4 +172,4 @@ function(add_package_dependency) endif() -endfunction(ADD_PACKAGE_DEPENDENCY) +endfunction() diff --git a/tribits/common_tpls/utils/ParseLibraryList.cmake b/tribits/common_tpls/utils/ParseLibraryList.cmake index 4fcb81685..3f1423b31 100644 --- a/tribits/common_tpls/utils/ParseLibraryList.cmake +++ b/tribits/common_tpls/utils/ParseLibraryList.cmake @@ -112,5 +112,5 @@ function(parse_library_list) set(${PARSE_ARGS_FOUND} FALSE PARENT_SCOPE) endif() -endfunction(PARSE_LIBRARY_LIST) +endfunction()