From d7771ba1f93b047891f2f1ab0aa3a9db86549fe2 Mon Sep 17 00:00:00 2001 From: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Date: Fri, 5 May 2023 17:08:18 -0500 Subject: CMake fix gen. exprs. and add h5copy help (#2918) --- c++/src/CMakeLists.txt | 4 +- c++/test/CMakeLists.txt | 2 +- config/cmake/FindSZIP.cmake | 127 -------------------------- config/cmake/HDFMacros.cmake | 6 +- fortran/examples/CMakeLists.txt | 4 +- fortran/src/CMakeLists.txt | 4 +- fortran/test/CMakeLists.txt | 24 ++--- release_docs/RELEASE.txt | 15 +++ src/CMakeLists.txt | 22 ++--- test/API/CMakeLists.txt | 4 +- test/CMakeLists.txt | 42 ++++----- testpar/API/CMakeLists.txt | 4 +- testpar/CMakeLists.txt | 8 +- tools/src/h5import/h5import.c | 2 +- tools/src/h5stat/h5stat.c | 2 +- tools/src/misc/h5delete.c | 2 +- tools/test/h5copy/CMakeTests.cmake | 32 +++++++ tools/test/h5copy/testfiles/h5copy_help1.ddl | 49 ++++++++++ tools/test/h5copy/testfiles/h5copy_help2.ddl | 49 ++++++++++ tools/test/h5stat/testfiles/h5stat_help1.ddl | 2 +- tools/test/h5stat/testfiles/h5stat_help2.ddl | 2 +- tools/test/h5stat/testfiles/h5stat_nofile.ddl | 2 +- 22 files changed, 213 insertions(+), 195 deletions(-) delete mode 100644 config/cmake/FindSZIP.cmake create mode 100644 tools/test/h5copy/testfiles/h5copy_help1.ddl create mode 100644 tools/test/h5copy/testfiles/h5copy_help2.ddl diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index ab1baed..1ba90ce 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -85,7 +85,7 @@ if (BUILD_STATIC_LIBS) ) target_compile_options(${HDF5_CPP_LIB_TARGET} PRIVATE "${HDF5_CMAKE_CXX_FLAGS}") target_compile_definitions(${HDF5_CPP_LIB_TARGET} - PRIVATE $<$:MPICH_SKIP_MPICXX;MPICH_IGNORE_CXX_SEEK># Parallel/MPI, prevent spurious cpp/cxx warnings + PRIVATE "$<$:MPICH_SKIP_MPICXX;MPICH_IGNORE_CXX_SEEK>"# Parallel/MPI, prevent spurious cpp/cxx warnings ) TARGET_C_PROPERTIES (${HDF5_CPP_LIB_TARGET} STATIC) target_link_libraries (${HDF5_CPP_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) @@ -104,7 +104,7 @@ if (BUILD_SHARED_LIBS) target_compile_options(${HDF5_CPP_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_CXX_FLAGS}") target_compile_definitions(${HDF5_CPP_LIBSH_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" - PRIVATE $<$:MPICH_SKIP_MPICXX;MPICH_IGNORE_CXX_SEEK># Parallel/MPI, prevent spurious cpp/cxx warnings + PRIVATE "$<$:MPICH_SKIP_MPICXX;MPICH_IGNORE_CXX_SEEK>"# Parallel/MPI, prevent spurious cpp/cxx warnings ) TARGET_C_PROPERTIES (${HDF5_CPP_LIBSH_TARGET} SHARED) target_link_libraries (${HDF5_CPP_LIBSH_TARGET} diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index 55aade2..308bc3b 100644 --- a/c++/test/CMakeLists.txt +++ b/c++/test/CMakeLists.txt @@ -41,7 +41,7 @@ add_executable (cpp_testhdf5 ${CPP_TEST_SOURCES} ${HDF5_CPP_TEST_SOURCE_DIR}/h5c target_include_directories (cpp_testhdf5 PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(cpp_testhdf5 PRIVATE "${HDF5_CMAKE_CXX_FLAGS}") target_compile_definitions(cpp_testhdf5 - PRIVATE $<$:MPICH_SKIP_MPICXX;MPICH_IGNORE_CXX_SEEK># Parallel/MPI, prevent spurious cpp/cxx warnings + PRIVATE "$<$:MPICH_SKIP_MPICXX;MPICH_IGNORE_CXX_SEEK>"# Parallel/MPI, prevent spurious cpp/cxx warnings ) if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (cpp_testhdf5 STATIC) diff --git a/config/cmake/FindSZIP.cmake b/config/cmake/FindSZIP.cmake deleted file mode 100644 index b96a732..0000000 --- a/config/cmake/FindSZIP.cmake +++ /dev/null @@ -1,127 +0,0 @@ -# -# Copyright by The HDF Group. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the COPYING file, which can be found at the root of the source code -# distribution tree, or in https://www.hdfgroup.org/licenses. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# -######################################################################### - -# - Derived from the FindTiff.cmake and FindJPEG.cmake that is included with cmake -# FindSZIP - -# Find the native SZIP includes and library - -# Imported targets -################## - -# This module defines the following :prop_tgt:`IMPORTED` targets: -# -# SZIP::SZIP -# The SZIP library, if found. -# -# Result variables -################### - -# This module will set the following variables in your project: - -# SZIP_FOUND, true if the SZIP headers and libraries were found. -# SZIP_INCLUDE_DIR, the directory containing the SZIP headers. -# SZIP_INCLUDE_DIRS, the directory containing the SZIP headers. -# SZIP_LIBRARIES, libraries to link against to use SZIP. - -# Cache variables -################# - -# The following variables may also be set: - -# SZIP_LIBRARY, where to find the SZIP library. -# SZIP_LIBRARY_DEBUG - Debug version of SZIP library -# SZIP_LIBRARY_RELEASE - Release Version of SZIP library - -# message (STATUS "Finding SZIP library and headers..." ) -######################################################################### - - -find_path(SZIP_INCLUDE_DIR szlib.h) - -set(szip_names ${SZIP_NAMES} sz szip szip-static libsz libszip libszip-static) -foreach(name ${szip_names}) - list (APPEND szip_names_debug "${name}d") -endforeach() - -if(NOT SZIP_LIBRARY) - find_library(SZIP_LIBRARY_RELEASE NAMES ${szip_names}) - find_library(SZIP_LIBRARY_DEBUG NAMES ${szip_names_debug}) - include(SelectLibraryConfigurations) - select_library_configurations(SZIP) - mark_as_advanced(SZIP_LIBRARY_RELEASE SZIP_LIBRARY_DEBUG) -endif() -unset(szip_names) -unset(szip_names_debug) - -if(SZIP_INCLUDE_DIR AND EXISTS "${SZIP_INCLUDE_DIR}/SZconfig.h") - file(STRINGS "${SZIP_INCLUDE_DIR}/SZconfig.h" szip_version_str - REGEX "^#define[\t ]+SZIP_PACKAGE_VERSION[\t ]+.*") - - string(REGEX REPLACE "^#define[\t ]+SZIP_PACKAGE_VERSION[\t ]+([0-9]+).*" - "\\1" SZIP_VERSION "${szip_version_str}") - unset(szip_version_str) -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(SZIP - REQUIRED_VARS SZIP_LIBRARY SZIP_INCLUDE_DIR - VERSION_VAR SZIP_VERSION) - -if(SZIP_FOUND) - set(SZIP_LIBRARIES ${SZIP_LIBRARY}) - set(SZIP_INCLUDE_DIRS "${SZIP_INCLUDE_DIR}") - - if(NOT TARGET SZIP::SZIP) - add_library(SZIP::SZIP UNKNOWN IMPORTED) - if(SZIP_INCLUDE_DIRS) - set_target_properties(SZIP::SZIP PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${SZIP_INCLUDE_DIRS}") - endif() - if(EXISTS "${SZIP_LIBRARY}") - set_target_properties(SZIP::SZIP PROPERTIES - IMPORTED_LINK_INTERFACE_LANGUAGES "C" - IMPORTED_LOCATION "${SZIP_LIBRARY}") - endif() - if(EXISTS "${SZIP_LIBRARY_RELEASE}") - set_property(TARGET SZIP::SZIP APPEND PROPERTY - IMPORTED_CONFIGURATIONS RELEASE) - set_target_properties(SZIP::SZIP PROPERTIES - IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C" - IMPORTED_LOCATION_RELEASE "${SZIP_LIBRARY_RELEASE}") - endif() - if(EXISTS "${SZIP_LIBRARY_DEBUG}") - set_property(TARGET SZIP::SZIP APPEND PROPERTY - IMPORTED_CONFIGURATIONS DEBUG) - set_target_properties(SZIP::SZIP PROPERTIES - IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C" - IMPORTED_LOCATION_DEBUG "${SZIP_LIBRARY_DEBUG}") - endif() - endif() -endif() - -mark_as_advanced(SZIP_LIBRARY SZIP_INCLUDE_DIR) - -# Report the results. -if (NOT SZIP_FOUND) - set (SZIP_DIR_MESSAGE - "SZip was not found. Make sure SZIP_LIBRARY and SZIP_INCLUDE_DIR are set or set the SZIP_INSTALL environment variable." - ) - if (NOT SZIP_FIND_QUIETLY) - message (VERBOSE "${SZIP_DIR_MESSAGE}") - else () - if (SZIP_FIND_REQUIRED) - message (FATAL_ERROR "SZip was NOT found and is Required by this project") - endif () - endif () -endif () diff --git a/config/cmake/HDFMacros.cmake b/config/cmake/HDFMacros.cmake index e0e1220..be9ceaf 100644 --- a/config/cmake/HDFMacros.cmake +++ b/config/cmake/HDFMacros.cmake @@ -77,7 +77,7 @@ macro (INSTALL_TARGET_PDB libtarget targetdestination targetcomponent) if (${target_type} MATCHES "SHARED") set (targetfilename $) else () - get_property (target_name TARGET ${libtarget} PROPERTY $,$>,OUTPUT_NAME_DEBUG,OUTPUT_NAME_RELWITHDEBINFO>) + get_property (target_name TARGET ${libtarget} PROPERTY "$,$>,OUTPUT_NAME_DEBUG,OUTPUT_NAME_RELWITHDEBINFO>") set (targetfilename $/${target_name}.pdb) endif () install ( @@ -213,8 +213,8 @@ endmacro () #------------------------------------------------------------------------------- macro (TARGET_C_PROPERTIES wintarget libtype) target_compile_options(${wintarget} PRIVATE - $<$:${WIN_COMPILE_FLAGS}> - $<$:${WIN_COMPILE_FLAGS}> + "$<$:${WIN_COMPILE_FLAGS}>" + "$<$:${WIN_COMPILE_FLAGS}>" ) if(MSVC) set_property(TARGET ${wintarget} APPEND PROPERTY LINK_FLAGS "${WIN_LINK_FLAGS}") diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index e7edf40..3a16c23 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -137,7 +137,7 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) PRIVATE ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} - $<$:${MPI_Fortran_LIBRARIES}> + "$<$:${MPI_Fortran_LIBRARIES}>" ) set_target_properties (f90_ex_ph5example PROPERTIES LINKER_LANGUAGE Fortran @@ -158,7 +158,7 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) PRIVATE ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} - $<$:${MPI_Fortran_LIBRARIES}> + "$<$:${MPI_Fortran_LIBRARIES}>" ) set_target_properties (f90_ex_ph5example PROPERTIES LINKER_LANGUAGE Fortran diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 5cfdead..fbe9468 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -339,7 +339,7 @@ if (BUILD_STATIC_LIBS) PUBLIC ${HDF5_F90_C_LIB_TARGET} PRIVATE ${LINK_Fortran_LIBS} - $<$:${MPI_Fortran_LIBRARIES}> + "$<$:${MPI_Fortran_LIBRARIES}>" ) # set_property(TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) # set_property(TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) @@ -372,7 +372,7 @@ if (BUILD_SHARED_LIBS) ) target_link_libraries (${HDF5_F90_LIBSH_TARGET} PUBLIC ${HDF5_F90_C_LIBSH_TARGET} - PRIVATE ${LINK_Fortran_LIBS} $<$:${MPI_Fortran_LIBRARIES}> + PRIVATE ${LINK_Fortran_LIBS} "$<$:${MPI_Fortran_LIBRARIES}>" ) # set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) # set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index e885427..67c8b75 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -224,7 +224,7 @@ if(MSVC) endif() if (NOT BUILD_SHARED_LIBS) target_include_directories (testhdf5_fortran PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static") - target_link_libraries (testhdf5_fortran PRIVATE ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$:ws2_32.lib>) + target_link_libraries (testhdf5_fortran PRIVATE ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$:ws2_32.lib>") set_target_properties (testhdf5_fortran PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -233,7 +233,7 @@ if (NOT BUILD_SHARED_LIBS) add_dependencies (testhdf5_fortran ${HDF5_F90_TEST_LIB_TARGET}) else () target_include_directories (testhdf5_fortran PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared") - target_link_libraries (testhdf5_fortran PRIVATE ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$:ws2_32.lib>) + target_link_libraries (testhdf5_fortran PRIVATE ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} "$<$:ws2_32.lib>") set_target_properties (testhdf5_fortran PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -263,7 +263,7 @@ if(MSVC) endif() if (NOT BUILD_SHARED_LIBS) target_include_directories (testhdf5_fortran_1_8 PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static") - target_link_libraries (testhdf5_fortran_1_8 PRIVATE ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$:ws2_32.lib>) + target_link_libraries (testhdf5_fortran_1_8 PRIVATE ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$:ws2_32.lib>") set_target_properties (testhdf5_fortran_1_8 PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -272,7 +272,7 @@ if (NOT BUILD_SHARED_LIBS) add_dependencies (testhdf5_fortran_1_8 ${HDF5_F90_TEST_LIB_TARGET}) else () target_include_directories (testhdf5_fortran_1_8 PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared") - target_link_libraries (testhdf5_fortran_1_8 PRIVATE ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$:ws2_32.lib>) + target_link_libraries (testhdf5_fortran_1_8 PRIVATE ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} "$<$:ws2_32.lib>") set_target_properties (testhdf5_fortran_1_8 PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -304,7 +304,7 @@ if(MSVC) endif() if (NOT BUILD_SHARED_LIBS) target_include_directories (fortranlib_test_F03 PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static") - target_link_libraries (fortranlib_test_F03 PRIVATE ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$:ws2_32.lib>) + target_link_libraries (fortranlib_test_F03 PRIVATE ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$:ws2_32.lib>") set_target_properties (fortranlib_test_F03 PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -313,7 +313,7 @@ if (NOT BUILD_SHARED_LIBS) add_dependencies (fortranlib_test_F03 ${HDF5_F90_TEST_LIB_TARGET}) else () target_include_directories (fortranlib_test_F03 PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared") - target_link_libraries (fortranlib_test_F03 PRIVATE ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$:ws2_32.lib>) + target_link_libraries (fortranlib_test_F03 PRIVATE ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} "$<$:ws2_32.lib>") set_target_properties (fortranlib_test_F03 PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -336,7 +336,7 @@ if(MSVC) endif() if (NOT BUILD_SHARED_LIBS) target_include_directories (fflush1 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) - target_link_libraries (fflush1 PRIVATE ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} $<$:ws2_32.lib>) + target_link_libraries (fflush1 PRIVATE ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$:ws2_32.lib>") set_target_properties (fflush1 PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -345,7 +345,7 @@ if (NOT BUILD_SHARED_LIBS) add_dependencies (fflush1 ${HDF5_F90_TEST_LIB_TARGET}) else () target_include_directories (fflush1 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - target_link_libraries (fflush1 PRIVATE ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$:ws2_32.lib>) + target_link_libraries (fflush1 PRIVATE ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} "$<$:ws2_32.lib>") set_target_properties (fflush1 PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -368,7 +368,7 @@ if(MSVC) endif() if (NOT BUILD_SHARED_LIBS) target_include_directories (fflush2 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) - target_link_libraries (fflush2 PRIVATE ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$:ws2_32.lib>) + target_link_libraries (fflush2 PRIVATE ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$:ws2_32.lib>") set_target_properties (fflush2 PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -377,7 +377,7 @@ if (NOT BUILD_SHARED_LIBS) add_dependencies (fflush2 ${HDF5_F90_TEST_LIB_TARGET}) else () target_include_directories (fflush2 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - target_link_libraries (fflush2 PRIVATE ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$:ws2_32.lib>) + target_link_libraries (fflush2 PRIVATE ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} "$<$:ws2_32.lib>") set_target_properties (fflush2 PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -400,7 +400,7 @@ if(MSVC) endif() if (NOT BUILD_SHARED_LIBS) target_include_directories (vol_connector PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) - target_link_libraries (vol_connector PRIVATE ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} $<$:ws2_32.lib>) + target_link_libraries (vol_connector PRIVATE ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$:ws2_32.lib>") set_target_properties (vol_connector PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -409,7 +409,7 @@ if (NOT BUILD_SHARED_LIBS) add_dependencies (vol_connector ${HDF5_F90_TEST_LIB_TARGET}) else () target_include_directories (vol_connector PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - target_link_libraries (vol_connector PRIVATE ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$:ws2_32.lib>) + target_link_libraries (vol_connector PRIVATE ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} "$<$:ws2_32.lib>") set_target_properties (vol_connector PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index d46e0b2..dcba32b 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -103,6 +103,8 @@ New Features LIBAEC library has been used in HDF5 binaries as the szip library of choice for a few years. We are removing the options for using the old SZIP library. + Also removed the config/cmake/FindSZIP.cmake file. + - Enabled instrumentation of the library by default in CMake for parallel debug builds @@ -415,6 +417,19 @@ Bug Fixes since HDF5-1.14.0 release Configuration ------------- + - Fixed syntax of generator expressions used by CMake + + Add quotes around the generator expression should allow CMake to + correctly parse the expression. Generator expressions are typically + parsed after command arguments. If a generator expression contains + spaces, new lines, semicolons or other characters that may be + interpreted as command argument separators, the whole expression + should be surrounded by quotes when passed to a command. Failure to + do so may result in the expression being split and it may no longer + be recognized as a generator expression. + + Fixes GitHub issue #2906 + - Fixed improper include of Subfiling VFD build directory With the release of the Subfiling Virtual File Driver feature, compiler diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7e6e487..eacefd4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1238,18 +1238,18 @@ if (BUILD_STATIC_LIBS) ${HDF_EXTRA_C_FLAGS} ${HDF_EXTRA_FLAGS} PRIVATE - $<$:H5_DEBUG_API> # Enable tracing of the API - $<$:${HDF5_DEBUG_APIS}> - $<$:${HDF5_DEVELOPER_DEFS}> + "$<$:H5_DEBUG_API>" # Enable tracing of the API + "$<$:${HDF5_DEBUG_APIS}>" + "$<$:${HDF5_DEVELOPER_DEFS}>" ) TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC) target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS} - PUBLIC $<$>:${CMAKE_DL_LIBS}> "$<$:MPI::MPI_C>" + PUBLIC "$<$>:${CMAKE_DL_LIBS}>" "$<$:MPI::MPI_C>" ) if (NOT WIN32) target_link_libraries (${HDF5_LIB_TARGET} - PRIVATE $<$,$>:Threads::Threads> + PRIVATE "$<$,$>:Threads::Threads>" ) endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) @@ -1280,16 +1280,16 @@ if (BUILD_SHARED_LIBS) ${HDF_EXTRA_C_FLAGS} ${HDF_EXTRA_FLAGS} PRIVATE - $<$:H5_HAVE_THREADSAFE> - $<$:H5_DEBUG_API> # Enable tracing of the API - $<$:${HDF5_DEBUG_APIS}> - $<$:${HDF5_DEVELOPER_DEFS}> + "$<$:H5_HAVE_THREADSAFE>" + "$<$:H5_DEBUG_API>" # Enable tracing of the API + "$<$:${HDF5_DEBUG_APIS}>" + "$<$:${HDF5_DEVELOPER_DEFS}>" ) TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED) target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS} - $<$,$>:Threads::Threads> - PUBLIC $<$>:${CMAKE_DL_LIBS}> "$<$:MPI::MPI_C>" + "$<$,$>:Threads::Threads>" + PUBLIC "$<$>:${CMAKE_DL_LIBS}>" "$<$:MPI::MPI_C>" ) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_LIBSH_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_LIBSH_TARGET} ${HDF5_LIB_NAME} SHARED "LIB") diff --git a/test/API/CMakeLists.txt b/test/API/CMakeLists.txt index dd2bca2..606aa9c 100644 --- a/test/API/CMakeLists.txt +++ b/test/API/CMakeLists.txt @@ -134,7 +134,7 @@ target_compile_options ( target_compile_definitions ( h5_api_test PRIVATE - $<$:${HDF5_DEVELOPER_DEFS}> + "$<$:${HDF5_DEVELOPER_DEFS}>" ) if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (h5_api_test STATIC) @@ -214,7 +214,7 @@ foreach (api_test_extra ${HDF5_API_TESTS_EXTRA}) target_compile_definitions ( h5_api_test_${api_test_extra} PRIVATE - $<$:${HDF5_DEVELOPER_DEFS}> + "$<$:${HDF5_DEVELOPER_DEFS}>" ) if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (h5_api_test_${api_test_extra} STATIC) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index fe52cd3..210ff22 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -37,12 +37,12 @@ if (BUILD_STATIC_LIBS) target_compile_definitions(${HDF5_TEST_LIB_TARGET} PRIVATE "H5_TEST_EXPRESS_LEVEL_DEFAULT=${H5_TEST_EXPRESS_LEVEL_DEFAULT}" - $<$:${HDF5_DEVELOPER_DEFS}> + "$<$:${HDF5_DEVELOPER_DEFS}>" ) TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} STATIC) target_link_libraries (${HDF5_TEST_LIB_TARGET} PUBLIC ${LINK_LIBS} ${HDF5_LIB_TARGET} - PRIVATE $<$,$>:ws2_32.lib> + PRIVATE "$<$,$>:ws2_32.lib>" ) if (MINGW) target_link_libraries (${HDF5_TEST_LIB_TARGET} PRIVATE "wsock32.lib") @@ -63,12 +63,12 @@ if (BUILD_SHARED_LIBS) "H5_BUILT_AS_DYNAMIC_LIB" PRIVATE "H5_TEST_EXPRESS_LEVEL_DEFAULT=${H5_TEST_EXPRESS_LEVEL_DEFAULT}" - $<$:${HDF5_DEVELOPER_DEFS}> + "$<$:${HDF5_DEVELOPER_DEFS}>" ) TARGET_C_PROPERTIES (${HDF5_TEST_LIBSH_TARGET} SHARED) target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PUBLIC ${LINK_LIBS} ${HDF5_LIBSH_TARGET} - PRIVATE $<$,$>:ws2_32.lib> + PRIVATE "$<$,$>:ws2_32.lib>" ) if (MINGW) target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PRIVATE "wsock32.lib") @@ -401,7 +401,7 @@ macro (ADD_H5_EXE file) target_compile_options(${file} PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_compile_definitions(${file} PRIVATE - $<$:${HDF5_DEVELOPER_DEFS}> + "$<$:${HDF5_DEVELOPER_DEFS}>" ) if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (${file} STATIC) @@ -445,7 +445,7 @@ add_executable (chunk_info ${HDF5_TEST_SOURCE_DIR}/chunk_info.c) target_compile_options(chunk_info PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_compile_definitions(chunk_info PRIVATE - $<$:${HDF5_DEVELOPER_DEFS}> + "$<$:${HDF5_DEVELOPER_DEFS}>" ) target_include_directories (chunk_info PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) @@ -469,7 +469,7 @@ add_executable (direct_chunk ${HDF5_TEST_SOURCE_DIR}/direct_chunk.c) target_compile_options(direct_chunk PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_compile_definitions(direct_chunk PRIVATE - $<$:${HDF5_DEVELOPER_DEFS}> + "$<$:${HDF5_DEVELOPER_DEFS}>" ) target_include_directories (direct_chunk PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) @@ -494,7 +494,7 @@ add_executable (testhdf5 ${testhdf5_SOURCES}) target_compile_options(testhdf5 PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_compile_definitions(testhdf5 PRIVATE - $<$:${HDF5_DEVELOPER_DEFS}> + "$<$:${HDF5_DEVELOPER_DEFS}>" ) target_include_directories (testhdf5 PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) @@ -518,7 +518,7 @@ add_executable (cache_image ${cache_image_SOURCES}) target_compile_options(cache_image PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_compile_definitions(cache_image PRIVATE - $<$:${HDF5_DEVELOPER_DEFS}> + "$<$:${HDF5_DEVELOPER_DEFS}>" ) target_include_directories (cache_image PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) @@ -542,7 +542,7 @@ add_executable (ttsafe ${ttsafe_SOURCES}) target_compile_options(ttsafe PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_compile_definitions(ttsafe PRIVATE - $<$:${HDF5_DEVELOPER_DEFS}> + "$<$:${HDF5_DEVELOPER_DEFS}>" ) target_include_directories (ttsafe PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) @@ -550,12 +550,12 @@ if (NOT BUILD_SHARED_LIBS) target_link_libraries (ttsafe PRIVATE ${HDF5_TEST_LIB_TARGET}) if (NOT WIN32) target_link_libraries (ttsafe - PRIVATE $<$:Threads::Threads> + PRIVATE "$<$:Threads::Threads>" ) endif () else () TARGET_C_PROPERTIES (ttsafe SHARED) - target_link_libraries (ttsafe PRIVATE ${HDF5_TEST_LIBSH_TARGET} $<$:Threads::Threads>) + target_link_libraries (ttsafe PRIVATE ${HDF5_TEST_LIBSH_TARGET} "$<$:Threads::Threads>") endif () set_target_properties (ttsafe PROPERTIES FOLDER test) @@ -572,7 +572,7 @@ add_executable (thread_id ${HDF5_TEST_SOURCE_DIR}/thread_id.c) target_compile_options(thread_id PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_compile_definitions(thread_id PRIVATE - $<$:${HDF5_DEVELOPER_DEFS}> + "$<$:${HDF5_DEVELOPER_DEFS}>" ) target_include_directories (thread_id PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) @@ -580,12 +580,12 @@ if (NOT BUILD_SHARED_LIBS) target_link_libraries (thread_id PRIVATE ${HDF5_TEST_LIB_TARGET}) if (NOT WIN32) target_link_libraries (thread_id - PRIVATE $<$:Threads::Threads> + PRIVATE "$<$:Threads::Threads>" ) endif () else () TARGET_C_PROPERTIES (thread_id SHARED) - target_link_libraries (thread_id PRIVATE ${HDF5_TEST_LIBSH_TARGET} $<$:Threads::Threads>) + target_link_libraries (thread_id PRIVATE ${HDF5_TEST_LIBSH_TARGET} "$<$:Threads::Threads>") endif () set_target_properties (thread_id PROPERTIES FOLDER test) @@ -682,7 +682,7 @@ macro (ADD_H5_VDS_EXE file) target_compile_options(${file} PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_compile_definitions(${file} PRIVATE - $<$:${HDF5_DEVELOPER_DEFS}> + "$<$:${HDF5_DEVELOPER_DEFS}>" ) if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (${file} STATIC) @@ -712,7 +712,7 @@ add_executable (accum_swmr_reader ${HDF5_TEST_SOURCE_DIR}/accum_swmr_reader.c) target_compile_options(accum_swmr_reader PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_compile_definitions(accum_swmr_reader PRIVATE - $<$:${HDF5_DEVELOPER_DEFS}> + "$<$:${HDF5_DEVELOPER_DEFS}>" ) target_include_directories (accum_swmr_reader PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) @@ -786,7 +786,7 @@ add_executable (use_append_chunk ${use_append_chunk_SOURCES}) target_compile_options(use_append_chunk PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_compile_definitions(use_append_chunk PRIVATE - $<$:${HDF5_DEVELOPER_DEFS}> + "$<$:${HDF5_DEVELOPER_DEFS}>" ) target_include_directories (use_append_chunk PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) @@ -811,7 +811,7 @@ if (HDF5_BUILD_UTILS) # requires mirror server target_compile_options(use_append_chunk_mirror PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_compile_definitions(use_append_chunk_mirror PRIVATE - $<$:${HDF5_DEVELOPER_DEFS}> + "$<$:${HDF5_DEVELOPER_DEFS}>" ) target_include_directories (use_append_chunk_mirror PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) @@ -836,7 +836,7 @@ add_executable (use_append_mchunks ${use_append_mchunks_SOURCES}) target_compile_options(use_append_mchunks PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_compile_definitions(use_append_mchunks PRIVATE - $<$:${HDF5_DEVELOPER_DEFS}> + "$<$:${HDF5_DEVELOPER_DEFS}>" ) target_include_directories (use_append_mchunks PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) @@ -860,7 +860,7 @@ add_executable (use_disable_mdc_flushes ${use_disable_mdc_flushes_SOURCES}) target_compile_options(use_disable_mdc_flushes PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_compile_definitions(use_disable_mdc_flushes PRIVATE - $<$:${HDF5_DEVELOPER_DEFS}> + "$<$:${HDF5_DEVELOPER_DEFS}>" ) target_include_directories (use_disable_mdc_flushes PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) diff --git a/testpar/API/CMakeLists.txt b/testpar/API/CMakeLists.txt index e907078..f893f0c 100644 --- a/testpar/API/CMakeLists.txt +++ b/testpar/API/CMakeLists.txt @@ -94,7 +94,7 @@ target_compile_options ( target_compile_definitions ( h5_api_test_parallel PRIVATE - $<$:${HDF5_DEVELOPER_DEFS}> + "$<$:${HDF5_DEVELOPER_DEFS}>" ) if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (h5_api_test_parallel STATIC) @@ -173,7 +173,7 @@ foreach (api_test_extra ${HDF5_API_PAR_TESTS_EXTRA}) target_compile_definitions ( h5_api_test_parallel_${api_test_extra} PRIVATE - $<$:${HDF5_DEVELOPER_DEFS}> + "$<$:${HDF5_DEVELOPER_DEFS}>" ) if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (h5_api_test_parallel_${api_test_extra} STATIC) diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index 6bb5fa6..7894cff 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -26,7 +26,7 @@ add_executable (testphdf5 ${testphdf5_SOURCES}) target_compile_options(testphdf5 PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_compile_definitions(testphdf5 PRIVATE - $<$:${HDF5_DEVELOPER_DEFS}> + "$<$:${HDF5_DEVELOPER_DEFS}>" ) target_include_directories (testphdf5 PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" @@ -56,7 +56,7 @@ macro (ADD_H5P_EXE file) target_compile_options(${file} PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_compile_definitions(${file} PRIVATE - $<$:${HDF5_DEVELOPER_DEFS}> + "$<$:${HDF5_DEVELOPER_DEFS}>" ) target_include_directories (${file} PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" @@ -65,13 +65,13 @@ macro (ADD_H5P_EXE file) TARGET_C_PROPERTIES (${file} STATIC) target_link_libraries (${file} PRIVATE ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$:MPI::MPI_C>" - $<$,$>:ws2_32.lib> + "$<$,$>:ws2_32.lib>" ) else () TARGET_C_PROPERTIES (${file} SHARED) target_link_libraries (${file} PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} "$<$:MPI::MPI_C>" - $<$,$>:ws2_32.lib> + "$<$,$>:ws2_32.lib>" ) endif () set_target_properties (${file} PROPERTIES FOLDER test/par) diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index e63b6a8..5a2fae3 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -5097,7 +5097,7 @@ help(char *name) void usage(char *name) { - (void)HDfprintf(stdout, "\nUsage:\t%s -h[elp], OR\n", name); + (void)HDfprintf(stdout, "\nusage:\t%s -h[elp], OR\n", name); (void)HDfprintf(stdout, "\t%s -c[onfig] \ [ -c[config] ...] -o[utfile] \n\n", name); diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c index 04d1723..05e0be8 100644 --- a/tools/src/h5stat/h5stat.c +++ b/tools/src/h5stat/h5stat.c @@ -208,7 +208,7 @@ static void usage(const char *prog) { HDfflush(stdout); - HDfprintf(stdout, "Usage: %s [OPTIONS] file\n", prog); + HDfprintf(stdout, "usage: %s [OPTIONS] file\n", prog); HDfprintf(stdout, "\n"); HDfprintf(stdout, " ERROR\n"); HDfprintf(stdout, " --enable-error-stack Prints messages from the HDF5 error stack as they occur\n"); diff --git a/tools/src/misc/h5delete.c b/tools/src/misc/h5delete.c index 20e81a1..ef5b25f 100644 --- a/tools/src/misc/h5delete.c +++ b/tools/src/misc/h5delete.c @@ -25,7 +25,7 @@ static void usage(void); static void usage(void) { - HDfprintf(stderr, "Usage: h5delete [-f] \n"); + HDfprintf(stderr, "usage: h5delete [-f] \n"); } int diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake index 05288b4..b47000a 100644 --- a/tools/test/h5copy/CMakeTests.cmake +++ b/tools/test/h5copy/CMakeTests.cmake @@ -35,6 +35,8 @@ ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/tudfilter.h5_ERR.txt ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/h5copy_plugin_fail_ERR.out.h5.txt ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/h5copy_plugin_test.out.h5.txt + ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/h5copy_help1.ddl + ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/h5copy_help2.ddl ) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") @@ -393,6 +395,32 @@ endif () endmacro () + macro (ADD_SIMPLE_TEST resultfile resultcode) + # If using memchecker add tests without using scripts + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5COPY-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ ${ARGN}) + if (${resultcode}) + set_tests_properties (H5COPY-${resultfile} PROPERTIES WILL_FAIL "true") + endif () + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5COPY-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=./testfiles/${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=./testfiles/${resultfile}.ddl" + -P "${HDF_RESOURCES_DIR}/runTest.cmake" + ) + endif () + set_tests_properties (H5COPY-${resultfile} PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}" + ) + endmacro () + ############################################################################## ############################################################################## ### T H E T E S T S ### @@ -420,6 +448,10 @@ set (USE_FILTER_SZIP "true") endif () +# Test for help flag + ADD_SIMPLE_TEST (h5copy_help1 0 -h) + ADD_SIMPLE_TEST (h5copy_help2 0 --help) + # "Test copying various forms of datasets" ADD_H5_TEST (simple 0 ${HDF_FILE1}.h5 -v -s simple -d simple) ADD_H5_TEST (chunk 0 ${HDF_FILE1}.h5 -v -s chunk -d chunk) diff --git a/tools/test/h5copy/testfiles/h5copy_help1.ddl b/tools/test/h5copy/testfiles/h5copy_help1.ddl new file mode 100644 index 0000000..418faea --- /dev/null +++ b/tools/test/h5copy/testfiles/h5copy_help1.ddl @@ -0,0 +1,49 @@ + +usage: h5copy [OPTIONS] [OBJECTS...] + OBJECTS + -i, --input input file name + -o, --output output file name + -s, --source source object name + -d, --destination destination object name + ERROR + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. + OPTIONS + -h, --help Print a usage message and exit + -p, --parents No error if existing, make parent groups as needed + -v, --verbose Print information about OBJECTS and OPTIONS + -V, --version Print version number and exit + -f, --flag Flag type + + Flag type is one of the following strings: + + shallow Copy only immediate members for groups + + soft Expand soft links into new objects + + ext Expand external links into new objects + + ref Copy references and any referenced objects, i.e., objects + that the references point to. + Referenced objects are copied in addition to the objects + specified on the command line and reference datasets are + populated with correct reference values. Copies of referenced + datasets outside the copy range specified on the command line + will normally have a different name from the original. + (Default:Without this option, reference value(s) in any + reference datasets are set to NULL and referenced objects are + not copied unless they are otherwise within the copy range + specified on the command line.) + + noattr Copy object without copying attributes + + allflags Switches all flags from the default to the non-default setting + + These flag types correspond to the following API symbols + + H5O_COPY_SHALLOW_HIERARCHY_FLAG + H5O_COPY_EXPAND_SOFT_LINK_FLAG + H5O_COPY_EXPAND_EXT_LINK_FLAG + H5O_COPY_EXPAND_REFERENCE_FLAG + H5O_COPY_WITHOUT_ATTR_FLAG + H5O_COPY_ALL diff --git a/tools/test/h5copy/testfiles/h5copy_help2.ddl b/tools/test/h5copy/testfiles/h5copy_help2.ddl new file mode 100644 index 0000000..418faea --- /dev/null +++ b/tools/test/h5copy/testfiles/h5copy_help2.ddl @@ -0,0 +1,49 @@ + +usage: h5copy [OPTIONS] [OBJECTS...] + OBJECTS + -i, --input input file name + -o, --output output file name + -s, --source source object name + -d, --destination destination object name + ERROR + --enable-error-stack Prints messages from the HDF5 error stack as they occur. + Optional value 2 also prints file open errors. + OPTIONS + -h, --help Print a usage message and exit + -p, --parents No error if existing, make parent groups as needed + -v, --verbose Print information about OBJECTS and OPTIONS + -V, --version Print version number and exit + -f, --flag Flag type + + Flag type is one of the following strings: + + shallow Copy only immediate members for groups + + soft Expand soft links into new objects + + ext Expand external links into new objects + + ref Copy references and any referenced objects, i.e., objects + that the references point to. + Referenced objects are copied in addition to the objects + specified on the command line and reference datasets are + populated with correct reference values. Copies of referenced + datasets outside the copy range specified on the command line + will normally have a different name from the original. + (Default:Without this option, reference value(s) in any + reference datasets are set to NULL and referenced objects are + not copied unless they are otherwise within the copy range + specified on the command line.) + + noattr Copy object without copying attributes + + allflags Switches all flags from the default to the non-default setting + + These flag types correspond to the following API symbols + + H5O_COPY_SHALLOW_HIERARCHY_FLAG + H5O_COPY_EXPAND_SOFT_LINK_FLAG + H5O_COPY_EXPAND_EXT_LINK_FLAG + H5O_COPY_EXPAND_REFERENCE_FLAG + H5O_COPY_WITHOUT_ATTR_FLAG + H5O_COPY_ALL diff --git a/tools/test/h5stat/testfiles/h5stat_help1.ddl b/tools/test/h5stat/testfiles/h5stat_help1.ddl index 1f65f0d..54d6a31 100644 --- a/tools/test/h5stat/testfiles/h5stat_help1.ddl +++ b/tools/test/h5stat/testfiles/h5stat_help1.ddl @@ -1,4 +1,4 @@ -Usage: h5stat [OPTIONS] file +usage: h5stat [OPTIONS] file ERROR --enable-error-stack Prints messages from the HDF5 error stack as they occur diff --git a/tools/test/h5stat/testfiles/h5stat_help2.ddl b/tools/test/h5stat/testfiles/h5stat_help2.ddl index 1f65f0d..54d6a31 100644 --- a/tools/test/h5stat/testfiles/h5stat_help2.ddl +++ b/tools/test/h5stat/testfiles/h5stat_help2.ddl @@ -1,4 +1,4 @@ -Usage: h5stat [OPTIONS] file +usage: h5stat [OPTIONS] file ERROR --enable-error-stack Prints messages from the HDF5 error stack as they occur diff --git a/tools/test/h5stat/testfiles/h5stat_nofile.ddl b/tools/test/h5stat/testfiles/h5stat_nofile.ddl index 1f65f0d..54d6a31 100644 --- a/tools/test/h5stat/testfiles/h5stat_nofile.ddl +++ b/tools/test/h5stat/testfiles/h5stat_nofile.ddl @@ -1,4 +1,4 @@ -Usage: h5stat [OPTIONS] file +usage: h5stat [OPTIONS] file ERROR --enable-error-stack Prints messages from the HDF5 error stack as they occur -- cgit v0.12