From b2c78e15cf2e78221c0f04fa47107f9ce94393fe Mon Sep 17 00:00:00 2001 From: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Date: Mon, 19 Apr 2021 07:28:32 -0500 Subject: Cleanup CMake code for doxygen and perl shell scripts (#552) * OESS-98 convert plugin option to FetchContent, add tests * Fixes for pkcfg files because of plugin option * OESS-98 fix tools test for plugins * Keep doxygen comments under 100 chars long - format hint * Whitespace * HDFFV-11144 - Reclassify CMake messages * HDFFV-11099/11100 added help text * Reworked switch statement to compare string instead * Fix typo * Update CDash mode * Correct name of threadsafe * Correct option name * Undo accidental commit * Note LLVM 10 to 11 format default changes * Update format plugin * Undo clang-format version 11 changes * One more correction * Update supported platforms * Revert whitespace changes * Correct whitespace * Changes from PR#3 * HDFFV-11213 added option to control gcc10 warnings diagnostics * HDFFV-11212 Use the new references correctly in JNI utility and tests * format source * Fix typo * Add new test file * HDFFV-11212 - update test and remove unused arg * Minor non-space formatting changes * Use H5I_INVALID_ID instead of "-1" * source formatting * add missing testfile, update jni function * Undo commit of debug code * remove mislocated file * Fix h5repack test for handling of fapls and id close * Update h5diff test files usage text * HDFFV-11212 add new ref tests for JNI export dataset * src format update * Remove blank line typo * src format typo * long double requires %Lg * Another long double foramt specifer S.B. %Lg * issue with t128bit test * Windows issue with h5dump and type. * Fix review issues * refactor function nesting and fix error checks * format fixes * Remove untested functions and javadoc quiet comments * Restore TRY block. * Change string append errors to memory exception * revert to H5_JNI_FATAL_ERROR - support functions need work * Add assertion error for h5util functions * remove duplicate function * format fix * Revert HD function error handling * Update copyright comments * GH #386 java folder copyright corrections * Whitespace * GH #359 implement and fix tools 1.6 API usage * remove excessive comments * Flip inits to correct ifdef section * rework ifdef to be simpler * format issue * Reformat ifdef inits * remove static attribute * format compliance * Update names * Revert because logic relies on float not being int * Changes noticed from creating merge of #412 * Double underscore change * Correct compiler version variable used * Remove header guard underscores * Whitespace cleanup * Split format source and commit changes on repo push * remove pre-split setting * Change windows TS to use older VS. * correct window os name * HDFFV-11212 JNI export util and Javadoc * Suggested review changes * Another change found * Committing clang-format changes * HDFFV-11113 long double in tools * HDFFV-11113 add note * Disable long double tests for now * HDFFV-11228 remove arbitrary CMake warning groups. * Make each flag a string * Some Javadoc warning fixes * Updated javadoc fixes * # WARNING: head commit changed in the meantime HDFFV-11229 Fix long double usage in tools and java Changed h5dump and h5ls to just print 128-bit for long double type. Added test and file for dataset and attributes with all three float types. * Committing clang-format changes * HDFFV-11229 Add release note * HDFFV-11229 windows testfile needed * fix typo * Remove non supported message text * HDFFV-11229 - change ldouble test to check both native and general * HDFFV-11229 add second file compare * HDFFV-11229 fix reference file * HDFFV-11229 autotools check two refs * HDFFV-11229 revert back to removal of NATIVE_LDOUBLE in tools output * Committing clang-format changes * Update release note * Update attribute type of ref file * Change source of ninja for macs * try port instead of brew * Recommended is to use brew. * Undo non long double changes * remove unneeded file * Fix perl and doxygen CMake code Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- CMakeLists.txt | 8 ++++++++ doxygen/Doxyfile.in | 1 + src/CMakeLists.txt | 44 ++++++++++++++++++++++++++------------------ test/CMakeTests.cmake | 3 +-- test/ShellTests.cmake | 3 +-- 5 files changed, 37 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 99dc035..0771ac6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -508,6 +508,14 @@ else () endif () #----------------------------------------------------------------------------- +# perl is used in some optional src and tests, check availability +find_package (Perl) +if (PERL_FOUND) + set (H5_PERL_FOUND YES) +endif () +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- # Option to Build Static executables #----------------------------------------------------------------------------- option (BUILD_STATIC_EXECS "Build Static Executables" OFF) diff --git a/doxygen/Doxyfile.in b/doxygen/Doxyfile.in index 24fc4ba..2395d6c 100644 --- a/doxygen/Doxyfile.in +++ b/doxygen/Doxyfile.in @@ -263,6 +263,7 @@ TAB_SIZE = 4 ALIASES = +@INCLUDE_PATH = @DOXYGEN_INCLUDE_ALIASES_PATH@ @INCLUDE = @DOXYGEN_INCLUDE_ALIASES@ # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 06b0c8c..a07122d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -991,8 +991,7 @@ set (H5_PUBLIC_GENERATED_HEADERS option (HDF5_GENERATE_HEADERS "Rebuild Generated Files" ON) if (HDF5_GENERATE_HEADERS) set_source_files_properties(${H5_GENERATED_HEADERS} PROPERTIES GENERATED TRUE) - find_package (Perl) - if (PERL_FOUND) + if (H5_PERL_FOUND) execute_process ( COMMAND ${PERL_EXECUTABLE} ${HDF5_SOURCE_DIR}/bin/make_err ${HDF5_SRC_DIR}/H5err.txt OUTPUT_VARIABLE SCRIPT_OUTPUT ) @@ -1369,34 +1368,43 @@ endif () if (DOXYGEN_FOUND) set (DOXYGEN_PACKAGE ${HDF5_PACKAGE}) set (DOXYGEN_VERSION_STRING ${HDF5_VERSION_STRING}) - set (DOXYGEN_INCLUDE_ALIASES ${HDF5_DOXYGEN_DIR}/aliases) + set (DOXYGEN_INCLUDE_ALIASES_PATH ${HDF5_DOXYGEN_DIR}) + set (DOXYGEN_INCLUDE_ALIASES aliases) + set (DOXYGEN_VERBATIM_VARS DOXYGEN_INCLUDE_ALIASES) set (DOXYGEN_PROJECT_LOGO ${HDF5_DOXYGEN_DIR}/img/HDFG-logo.png) set (DOXYGEN_PROJECT_BRIEF "C-API Reference") - set (DOXYGEN_INPUT_DIRECTORY ${HDF5_SRC_DIR} ${HDF5_DOXYGEN_DIR}/dox ${HDF5_GENERATED_SOURCE_DIR}/shared) + set (DOXYGEN_INPUT_DIRECTORY "${HDF5_SRC_DIR} ${HDF5_DOXYGEN_DIR}/dox ${HDF5_GENERATED_SOURCE_DIR}/shared") set (DOXYGEN_OPTIMIZE_OUTPUT_FOR_C YES) set (DOXYGEN_MACRO_EXPANSION YES) set (DOXYGEN_OUTPUT_DIRECTORY ${HDF5_BINARY_DIR}/hdf5lib_docs) +# This configure and custom target work together # Replace variables inside @@ with the current values - configure_file(${HDF5_DOXYGEN_DIR}/Doxyfile.in Doxyfile @ONLY) - - doxygen_add_docs(hdf5lib_doc -# ${common_SRCS} ${shared_gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS} ${HDF5_DOXYGEN_DIR}/dox - ${DOXYGEN_INPUT_DIRECTORY} - ALL - WORKING_DIRECTORY ${HDF5_SRC_DIR} - COMMENT "Generating HDF5 library Source Documentation" - ) - install( + configure_file (${HDF5_DOXYGEN_DIR}/Doxyfile.in ${HDF5_BINARY_DIR}/Doxyfile @ONLY) + add_custom_target (hdf5lib_doc ALL + COMMAND ${DOXYGEN_EXECUTABLE} ${HDF5_BINARY_DIR}/Doxyfile + WORKING_DIRECTORY ${HDF5_SRC_DIR} + COMMENT "Generating HDF5 library Source API documentation with Doxygen" + VERBATIM ) +# This cmake function requires that the non-default doxyfile settings are provided with set (DOXYGEN_xxx) commands +# In addition the doxyfile aliases @INCLUDE option is not supported and would need to be provided in a set (DOXYGEN_ALIASES) command. +# doxygen_add_docs (hdf5lib_doc +## ${common_SRCS} ${shared_gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS} ${HDF5_DOXYGEN_DIR}/dox +# ${DOXYGEN_INPUT_DIRECTORY} +# ALL +# WORKING_DIRECTORY ${HDF5_SRC_DIR} +# COMMENT "Generating HDF5 library Source Documentation" +# ) + install ( DIRECTORY ${HDF5_BINARY_DIR}/hdf5lib_docs/html DESTINATION ${HDF5_INSTALL_DATA_DIR} COMPONENT Documents ) - if(NOT TARGET doxygen) - add_custom_target(doxygen) - endif() + if (NOT TARGET doxygen) + add_custom_target (doxygen) + endif () - add_dependencies(doxygen hdf5lib_doc) + add_dependencies (doxygen hdf5lib_doc) endif () diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 242c918..d3e0788 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -889,8 +889,7 @@ if (ENABLE_EXTENDED_TESTS) #-- Adding test for flushrefresh file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/flushrefresh_test") - find_package (Perl) - if (PERL_FOUND) + if (H5_PERL_FOUND) add_test ( NAME H5TEST-testflushrefresh-clear-objects COMMAND ${CMAKE_COMMAND} -E remove flushrefresh.h5 diff --git a/test/ShellTests.cmake b/test/ShellTests.cmake index 4676184..4d23de3 100644 --- a/test/ShellTests.cmake +++ b/test/ShellTests.cmake @@ -23,8 +23,7 @@ if (UNIX) ############################################################################## # configure scripts to test dir ############################################################################## - find_package (Perl) - if (PERL_FOUND) + if (H5_PERL_FOUND) configure_file(${HDF5_TEST_SOURCE_DIR}/testflushrefresh.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/testflushrefresh.sh @ONLY) endif () configure_file(${HDF5_TEST_SOURCE_DIR}/test_usecases.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/test_usecases.sh @ONLY) -- cgit v0.12