From 6e2e4610878ccf3709fb2bb305bfd4eb11289ba5 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 26 Mar 2019 14:00:27 -0500 Subject: HDFFV-10741 - add option to skip tool error stack tests --- CMakeLists.txt | 1 + hl/tools/h5watch/CMakeTests.cmake | 32 ++++++++----- release_docs/INSTALL_CMake.txt | 1 + release_docs/RELEASE.txt | 42 +++++++++------- tools/test/h5copy/CMakeTests.cmake | 34 ++++++++----- tools/test/h5dump/CMakeTests.cmake | 72 +++++++++++++++++----------- tools/test/h5format_convert/CMakeTests.cmake | 66 +++++++++++++++---------- tools/test/h5jam/CMakeTests.cmake | 34 ++++++++----- tools/test/h5ls/CMakeTests.cmake | 32 ++++++++----- tools/test/h5repack/CMakeTests.cmake | 34 ++++++++----- tools/test/h5stat/CMakeTests.cmake | 32 ++++++++----- tools/test/misc/CMakeTestsClear.cmake | 64 +++++++++++++++---------- 12 files changed, 275 insertions(+), 169 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c2eb94d..c95ae64 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -806,6 +806,7 @@ endif () if (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools") option (HDF5_BUILD_TOOLS "Build HDF5 Tools" ON) if (HDF5_BUILD_TOOLS) + option (SKIP_ERROR_STACK_TESTS "Skip HDF5 Tools Error Stack Tests" OFF) add_subdirectory (tools) endif () endif () diff --git a/hl/tools/h5watch/CMakeTests.cmake b/hl/tools/h5watch/CMakeTests.cmake index a4d3fa2..d608f3a 100644 --- a/hl/tools/h5watch/CMakeTests.cmake +++ b/hl/tools/h5watch/CMakeTests.cmake @@ -88,18 +88,26 @@ add_custom_target(H5WATCH_files ALL COMMENT "Copying files needed by H5WATCH tes macro (ADD_H5_ERR_TEST resultfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) - add_test ( - NAME H5WATCH_ARGS-h5watch-${resultfile} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}.mty" - -D "TEST_ERRREF=${resultfile}.err" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) + if (SKIP_ERROR_STACK_TESTS) + add_test ( + NAME H5WATCH_ARGS-h5watch-${resultfile} + COMMAND ${CMAKE_COMMAND} -E echo "SKIP Error Stack Test" + ) + set_property(TEST H5WATCH_ARGS-h5watch-${resultfile} PROPERTY DISABLED) + else () + add_test ( + NAME H5WATCH_ARGS-h5watch-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.mty" + -D "TEST_ERRREF=${resultfile}.err" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (H5WATCH_ARGS-h5watch-${resultfile} PROPERTIES DEPENDS ${last_test}) set (last_test "H5WATCH_ARGS-h5watch-${resultfile}") endif () diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 233c2cc..7505196 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -652,6 +652,7 @@ HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" HDF_TEST_EXPRESS "Control testing framework (0-3)" "0" HDF5_TEST_VFD "Execute tests with different VFDs" OFF HDF5_TEST_VOL "Execute tests with different VOL connectors" OFF +SKIP_ERROR_STACK_TESTS "Skip tests that check the error stack" OFF HDF5_USE_16_API_DEFAULT "Use the HDF5 1.6.x API by default" OFF HDF5_USE_18_API_DEFAULT "Use the HDF5 1.8.x API by default" OFF HDF5_USE_110_API_DEFAULT "Use the HDF5 1.10.x API by default" OFF diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index ec93e31..ae2f1e0 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -48,6 +48,14 @@ New Features Configuration: ------------- + - Skip tools test that test the error stack + + There are some use cases which can cause the error stack of tools to be + different then the expected. An option, SKIP_ERROR_STACK_TESTS, was added + that will skip over tests that test the error stack. + + (ADB - 2019/03/26, HDFFV-10741) + - Keep stderr and stdout separate in tests Changed test handling of output capture. Tests now keep the stderr @@ -149,8 +157,8 @@ New Features - Changed the default behavior in parallel when reading the same dataset in its entirely (i.e. H5S_ALL dataset selection) which is being read by all the processes collectively. The dataset mush be contiguous, less than 2GB, and of an atomic datatype. - The new behavior is the HDF5 library will use an MPI_Bcast to pass the data read from - the disk by the root process to the remain processes in the MPI communicator associated + The new behavior is the HDF5 library will use an MPI_Bcast to pass the data read from + the disk by the root process to the remain processes in the MPI communicator associated with the HDF5 file. (MSB - 2019/01/02, HDFFV-10652) @@ -165,10 +173,10 @@ New Features - Added new Fortran API, H5gmtime, which converts (C) 'time_t' structure to Fortran DATE AND TIME storage format. - + (MSB, 2019/01/08, HDFFV-10443) - - Added new Fortran 'fields' optional parameter to: h5ovisit_f, h5oget_info_by_name_f, + - Added new Fortran 'fields' optional parameter to: h5ovisit_f, h5oget_info_by_name_f, h5oget_info, h5oget_info_by_idx and h5ovisit_by_name_f. (MSB, 2019/01/08, HDFFV-10443) @@ -247,12 +255,12 @@ Bug Fixes since HDF5-1.10.3 release - Fixed memory leak in scale offset filter In a special case where the MinBits is the same as the number of bits in - the datatype's precision, the filter's data buffer was not freed, causing + the datatype's precision, the filter's data buffer was not freed, causing the memory usage to grow. In general the buffer was freed correctly. The - Minbits are the minimal number of bits to store the data values. Please + Minbits are the minimal number of bits to store the data values. Please see the reference manual for H5Pset_scaleoffset for the detail. - (RL - 2019/3/4, HDFFV-10705) + (RL - 2019/3/4, HDFFV-10705) - Fix hangs with collective metadata reads during chunked dataset I/O @@ -293,8 +301,8 @@ Bug Fixes since HDF5-1.10.3 release When deleting the attribute nodes from the name index v2 B-tree, if an attribute is found in the intermediate B-tree nodes, - which may be merged/redistributed in the process, we need to - free the dynamically allocated spaces for the intermediate + which may be merged/redistributed in the process, we need to + free the dynamically allocated spaces for the intermediate decoded attribute. (VC - 2018/12/26, HDFFV-10659) @@ -371,10 +379,10 @@ Bug Fixes since HDF5-1.10.3 release Fortran -------- - Added symbolic links libhdf5_hl_fortran.so to libhdf5hl_fortran.so and - libhdf5_hl_fortran.a to libhdf5hl_fortran.a in hdf5/lib directory for - autotools installs. These were added to match the name of the files - installed by cmake and the general pattern of hl lib files. We will - change the names of the installed lib files to the matching name in + libhdf5_hl_fortran.a to libhdf5hl_fortran.a in hdf5/lib directory for + autotools installs. These were added to match the name of the files + installed by cmake and the general pattern of hl lib files. We will + change the names of the installed lib files to the matching name in the next major release. (LRK - 2019/01/04, HDFFV-10596) @@ -385,7 +393,7 @@ Bug Fixes since HDF5-1.10.3 release (MSB, 2018/12/04, HDFFV-10511) - - Fixed issue with Fortran not returning h5o_info_t field values + - Fixed issue with Fortran not returning h5o_info_t field values meta_size%attr%index_size and meta_size%attr%heap_size. (MSB, 2018/1/8, HDFFV-10443) @@ -668,10 +676,10 @@ Bug Fixes since HDF5-1.10.2 release conversions from or to long double types, especially when special values such as infinity or NAN were involved. In some cases the results differed by extremely small amounts from those on other machines, while some other - tests resulted in segmentation faults. These conversion tests with long - double types have been disabled for ppc64 machines until the problems are + tests resulted in segmentation faults. These conversion tests with long + double types have been disabled for ppc64 machines until the problems are better understood and can be properly addressed. - + (SRL - 2019/01/07, TRILAB-98) Supported Platforms diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake index 85a8788..0a7090f 100644 --- a/tools/test/h5copy/CMakeTests.cmake +++ b/tools/test/h5copy/CMakeTests.cmake @@ -242,19 +242,27 @@ ./testfiles/${testname}.out.out ./testfiles/${testname}.out.out.err ) - add_test ( - NAME H5COPY-CMP-${testname} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS=-i;./testfiles/${infile};-o;./testfiles/${testname}.out.h5;${vparam};${sparam};${srcname};${dparam};${dstname}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=./testfiles/${testname}.out.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=./testfiles/${testname}.out" - -D "TEST_ERRREF=./testfiles/${testname}.err" - -D "TEST_MASK=true" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) + if (SKIP_ERROR_STACK_TESTS) + add_test ( + NAME H5COPY-CMP-${resultfile} + COMMAND ${CMAKE_COMMAND} -E echo "SKIP Error Stack Test" + ) + set_property(TEST H5COPY-CMP-${resultfile} PROPERTY DISABLED) + else () + add_test ( + NAME H5COPY-CMP-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS=-i;./testfiles/${infile};-o;./testfiles/${testname}.out.h5;${vparam};${sparam};${srcname};${dparam};${dstname}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=./testfiles/${testname}.out.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=./testfiles/${testname}.out" + -D "TEST_ERRREF=./testfiles/${testname}.err" + -D "TEST_MASK=true" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (H5COPY-CMP-${testname} PROPERTIES DEPENDS H5COPY-CMP-${testname}-clear-objects) endif () endmacro () diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake index 16dbc4d..2c46e00 100644 --- a/tools/test/h5dump/CMakeTests.cmake +++ b/tools/test/h5dump/CMakeTests.cmake @@ -679,19 +679,27 @@ ${resultfile}.out.err ) set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - add_test ( - NAME H5DUMP-${resultfile} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}.ddl" - -D "TEST_ERRREF=${resultfile}.err" - -D "TEST_MASK_ERROR=true" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) + if (SKIP_ERROR_STACK_TESTS) + add_test ( + NAME H5DUMP-${resultfile} + COMMAND ${CMAKE_COMMAND} -E echo "SKIP Error Stack Test" + ) + set_property(TEST H5DUMP-${resultfile} PROPERTY DISABLED) + else () + add_test ( + NAME H5DUMP-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ddl" + -D "TEST_ERRREF=${resultfile}.err" + -D "TEST_MASK_ERROR=true" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") endif () endmacro () @@ -707,21 +715,29 @@ ${resultfile}.out.err ) set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - add_test ( - NAME H5DUMP-${resultfile} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}.ddl" - -D "TEST_ERRREF=${resultfile}.err" - -D "TEST_MASK_ERROR=true" - -D "TEST_ENV_VAR:STRING=${envvar}" - -D "TEST_ENV_VALUE:STRING=${envval}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) + if (SKIP_ERROR_STACK_TESTS) + add_test ( + NAME H5DUMP-${resultfile} + COMMAND ${CMAKE_COMMAND} -E echo "SKIP Error Stack Test" + ) + set_property(TEST H5DUMP-${resultfile} PROPERTY DISABLED) + else () + add_test ( + NAME H5DUMP-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ddl" + -D "TEST_ERRREF=${resultfile}.err" + -D "TEST_MASK_ERROR=true" + -D "TEST_ENV_VAR:STRING=${envvar}" + -D "TEST_ENV_VALUE:STRING=${envval}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") endif () endmacro () diff --git a/tools/test/h5format_convert/CMakeTests.cmake b/tools/test/h5format_convert/CMakeTests.cmake index 5599c1b..0320ada 100644 --- a/tools/test/h5format_convert/CMakeTests.cmake +++ b/tools/test/h5format_convert/CMakeTests.cmake @@ -118,18 +118,26 @@ -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} ./testfiles/outtmp.h5 ) set_tests_properties (H5FC-${testname}-${testfile}-tmpfile PROPERTIES DEPENDS "H5FC-${testname}-clear-objects") - add_test ( - NAME H5FC-${testname}-${testfile} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS=${ARGN};outtmp.h5" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=${testname}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}" - -D "TEST_ERRREF=${resultfile}.err" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) + if (SKIP_ERROR_STACK_TESTS) + add_test ( + NAME H5FC-${testname}-${testfile} + COMMAND ${CMAKE_COMMAND} -E echo "SKIP Error Stack Test" + ) + set_property(TEST H5FC-${testname}-${testfile} PROPERTY DISABLED) + else () + add_test ( + NAME H5FC-${testname}-${testfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS=${ARGN};outtmp.h5" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${testname}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}" + -D "TEST_ERRREF=${resultfile}.err" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (H5FC-${testname}-${testfile} PROPERTIES DEPENDS "H5FC-${testname}-${testfile}-tmpfile") set (last_test "H5FC-${testname}-${testfile}") else () @@ -206,19 +214,27 @@ -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} ./testfiles/outtmp.h5 ) set_tests_properties (H5FC-${testname}-${testfile}-tmpfile PROPERTIES DEPENDS "H5FC-${testname}-clear-objects") - add_test ( - NAME H5FC-${testname}-${testfile} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS=${ARGN};outtmp.h5" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=${testname}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}" - -D "TEST_ERRREF=${resultfile}.err" - -D "TEST_MASK_ERROR=true" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) + if (SKIP_ERROR_STACK_TESTS) + add_test ( + NAME H5FC-${testname}-${testfile} + COMMAND ${CMAKE_COMMAND} -E echo "SKIP Error Stack Test" + ) + set_property(TEST H5FC-${testname}-${testfile} PROPERTY DISABLED) + else () + add_test ( + NAME H5FC-${testname}-${testfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS=${ARGN};outtmp.h5" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${testname}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}" + -D "TEST_ERRREF=${resultfile}.err" + -D "TEST_MASK_ERROR=true" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (H5FC-${testname}-${testfile} PROPERTIES DEPENDS "H5FC-${testname}-${testfile}-tmpfile") set (last_test "H5FC-${testname}-${testfile}") endif () diff --git a/tools/test/h5jam/CMakeTests.cmake b/tools/test/h5jam/CMakeTests.cmake index 677ba5c..6d328b5 100644 --- a/tools/test/h5jam/CMakeTests.cmake +++ b/tools/test/h5jam/CMakeTests.cmake @@ -66,19 +66,27 @@ ${expectfile}.out ${expectfile}.out.err ) - add_test ( - NAME H5JAM-${expectfile} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${expectfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_ERRREF=testfiles/${expectfile}.txt" - -D "TEST_SKIP_COMPARE=1" - -D "TEST_REFERENCE=testfiles/${expectfile}.txt" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) + if (SKIP_ERROR_STACK_TESTS) + add_test ( + NAME H5JAM-${resultfile} + COMMAND ${CMAKE_COMMAND} -E echo "SKIP Error Stack Test" + ) + set_property(TEST H5JAM-${resultfile} PROPERTY DISABLED) + else () + add_test ( + NAME H5JAM-${expectfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${expectfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_ERRREF=testfiles/${expectfile}.txt" + -D "TEST_SKIP_COMPARE=1" + -D "TEST_REFERENCE=testfiles/${expectfile}.txt" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (H5JAM-${expectfile} PROPERTIES DEPENDS "H5JAM-${expectfile}-clear-objects") endif () endmacro () diff --git a/tools/test/h5ls/CMakeTests.cmake b/tools/test/h5ls/CMakeTests.cmake index 95af5ab..2fbffe6 100644 --- a/tools/test/h5ls/CMakeTests.cmake +++ b/tools/test/h5ls/CMakeTests.cmake @@ -189,18 +189,26 @@ testfiles/${resultfile}.out testfiles/${resultfile}.out.err ) - add_test ( - NAME H5LS-${resultfile} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}.ls" - -D "TEST_ERRREF=${resultfile}.err" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) + if (SKIP_ERROR_STACK_TESTS) + add_test ( + NAME HH5LS-${resultfile} + COMMAND ${CMAKE_COMMAND} -E echo "SKIP Error Stack Test" + ) + set_property(TEST H5LS-${resultfile} PROPERTY DISABLED) + else () + add_test ( + NAME H5LS-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ls" + -D "TEST_ERRREF=${resultfile}.err" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS H5LS-${resultfile}-clear-objects) endif () endmacro () diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 2ad12ad..b0d3c9c 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -335,19 +335,27 @@ if (last_test) set_tests_properties (H5REPACK_MASK-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) endif () - add_test ( - NAME H5REPACK_MASK-${testname} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=${ARGN};${resultfile};out-${testname}.${resultfile}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=${resultfile}-${testname}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_MASK_ERROR=true" - -D "TEST_REFERENCE=${resultfile}.mty" - -D "TEST_ERRREF=${resultfile}-${testname}.tst" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) + if (SKIP_ERROR_STACK_TESTS) + add_test ( + NAME H5REPACK_MASK-${testname} + COMMAND ${CMAKE_COMMAND} -E echo "SKIP Error Stack Test" + ) + set_property(TEST H5REPACK_MASK-${testname} PROPERTY DISABLED) + else () + add_test ( + NAME H5REPACK_MASK-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN};${resultfile};out-${testname}.${resultfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${resultfile}-${testname}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_MASK_ERROR=true" + -D "TEST_REFERENCE=${resultfile}.mty" + -D "TEST_ERRREF=${resultfile}-${testname}.tst" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (H5REPACK_MASK-${testname} PROPERTIES DEPENDS H5REPACK_MASK-${testname}-clear-objects) endif () endif () diff --git a/tools/test/h5stat/CMakeTests.cmake b/tools/test/h5stat/CMakeTests.cmake index 737f4b5..4828c59 100644 --- a/tools/test/h5stat/CMakeTests.cmake +++ b/tools/test/h5stat/CMakeTests.cmake @@ -150,18 +150,26 @@ if (last_test) set_tests_properties (H5STAT-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test}) endif () - add_test ( - NAME H5STAT-${resultfile} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}.mty" - -D "TEST_ERRREF=${resultfile}.err" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) + if (SKIP_ERROR_STACK_TESTS) + add_test ( + NAME H5STAT-${resultfile} + COMMAND ${CMAKE_COMMAND} -E echo "SKIP Error Stack Test" + ) + set_property(TEST H5STAT-${resultfile} PROPERTY DISABLED) + else () + add_test ( + NAME H5STAT-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.mty" + -D "TEST_ERRREF=${resultfile}.err" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (H5STAT-${resultfile} PROPERTIES DEPENDS H5STAT-${resultfile}-clear-objects) endif () endmacro () diff --git a/tools/test/misc/CMakeTestsClear.cmake b/tools/test/misc/CMakeTestsClear.cmake index 24774fd..2aa3c4c 100644 --- a/tools/test/misc/CMakeTestsClear.cmake +++ b/tools/test/misc/CMakeTestsClear.cmake @@ -125,18 +125,26 @@ if (last_test) set_tests_properties (H5CLEAR_CMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) endif () - add_test ( - NAME H5CLEAR_CMP-${testname} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=${testname}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}.mty" - -D "TEST_ERRREF=${resultfile}.err" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) + if (SKIP_ERROR_STACK_TESTS) + add_test ( + NAME H5CLEAR_CMP-${testname} + COMMAND ${CMAKE_COMMAND} -E echo "SKIP Error Stack Test" + ) + set_property(TEST H5WATCH_ARGS-h5watch-${resultfile} PROPERTY DISABLED) + else () + add_test ( + NAME H5CLEAR_CMP-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${testname}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.mty" + -D "TEST_ERRREF=${resultfile}.err" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (H5CLEAR_CMP-${testname} PROPERTIES DEPENDS H5CLEAR_CMP-${testname}-clear-objects) set (last_test "H5CLEAR_CMP-${testname}") endif () @@ -198,18 +206,26 @@ "${PROJECT_SOURCE_DIR}/testfiles/${testfile}" "${PROJECT_BINARY_DIR}/testfiles/${testfile}" ) set_tests_properties (H5CLEAR_CMP-copy_${testname} PROPERTIES DEPENDS H5CLEAR_CMP-${testname}-clear-objects) - add_test ( - NAME H5CLEAR_CMP-${testname} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=${ARGN};${testfile}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=${testname}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}.mty" - -D "TEST_ERRREF=${resultfile}.err" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) + if (SKIP_ERROR_STACK_TESTS) + add_test ( + NAME H5CLEAR_CMP-${testname} + COMMAND ${CMAKE_COMMAND} -E echo "SKIP Error Stack Test" + ) + set_property(TEST H5CLEAR_CMP-${testname} PROPERTY DISABLED) + else () + add_test ( + NAME H5CLEAR_CMP-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN};${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${testname}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.mty" + -D "TEST_ERRREF=${resultfile}.err" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (H5CLEAR_CMP-${testname} PROPERTIES DEPENDS H5CLEAR_CMP-copy_${testname}) set (last_test "H5CLEAR_CMP-${testname}") endif () -- cgit v0.12 From 0d6fd55212cd3d1368c8058eacaa535d0bced044 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 28 Mar 2019 13:41:31 -0500 Subject: Correct examples for packaging --- config/cmake/HDF5_Examples.cmake.in | 2 + config/cmake/HDF5_Examples_options.cmake | 103 ------------------------------- config/cmake/README.txt.cmake.in | 2 +- release_docs/USING_CMake_Examples.txt | 2 + 4 files changed, 5 insertions(+), 104 deletions(-) diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in index c4d9cd8..bac174a 100644 --- a/config/cmake/HDF5_Examples.cmake.in +++ b/config/cmake/HDF5_Examples.cmake.in @@ -103,6 +103,8 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PAC if(WIN32) include(${CTEST_SCRIPT_DIRECTORY}\\HDF5_Examples_options.cmake) + include(${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake) else() include(${CTEST_SCRIPT_DIRECTORY}/HDF5_Examples_options.cmake) + include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) endif() diff --git a/config/cmake/HDF5_Examples_options.cmake b/config/cmake/HDF5_Examples_options.cmake index 6e4b510..386e99c 100644 --- a/config/cmake/HDF5_Examples_options.cmake +++ b/config/cmake/HDF5_Examples_options.cmake @@ -57,106 +57,3 @@ #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCOMPARE_TESTING:BOOL=ON") ############################################################################################# -# Do not edit below this line -############################################################################################# -#----------------------------------------------------------------------------- -# MAC machines need special option -#----------------------------------------------------------------------------- -if (APPLE) - # Compiler choice - execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) - set (ENV{CC} "${XCODE_CC}") - set (ENV{CXX} "${XCODE_CXX}") - if (NOT NO_MAC_FORTRAN) - # Shared fortran is not supported, build static - set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - else () - set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") - endif () - set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") -else () - set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS}") -endif () - -#----------------------------------------------------------------------------- -set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") -## -------------------------- -if (CTEST_USE_TAR_SOURCE) - ## Uncompress source if tar or zip file provided - ## -------------------------- - if (WIN32) - message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.zip]") - execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) - else () - message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]") - execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) - endif () - - if (NOT rv EQUAL 0) - message (STATUS "extracting... [error-(${rv}) clean up]") - file (REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") - message (FATAL_ERROR "error: extract of ${CTEST_SOURCE_NAME} failed") - endif () -endif() - -#----------------------------------------------------------------------------- -## Clear the build directory -## -------------------------- -set (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) -if (EXISTS "${CTEST_BINARY_DIRECTORY}" AND IS_DIRECTORY "${CTEST_BINARY_DIRECTORY}") - ctest_empty_binary_directory (${CTEST_BINARY_DIRECTORY}) -else () - file (MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") -endif () - -# Use multiple CPU cores to build -include (ProcessorCount) -ProcessorCount (N) -if (NOT N EQUAL 0) - if (NOT WIN32) - set (CTEST_BUILD_FLAGS -j${N}) - endif () - set (ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) -endif () -set (CTEST_CONFIGURE_COMMAND - "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" -) - -#----------------------------------------------------------------------------- -## -- set output to english -set ($ENV{LC_MESSAGES} "en_EN") - -#----------------------------------------------------------------------------- -configure_file (${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) -ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}") -## NORMAL process -## -------------------------- -ctest_start (Experimental) -ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -if (${res} LESS 0 OR ${res} GREATER 0) - file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Configure: ${res}\n") -endif () -if (LOCAL_SUBMIT) - ctest_submit (PARTS Configure Notes) -endif () -ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND APPEND RETURN_VALUE res NUMBER_ERRORS errval) -if (${res} LESS 0 OR ${res} GREATER 0 OR ${errval} GREATER 0) - file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed ${errval} Build: ${res}\n") -endif () -if (LOCAL_SUBMIT) - ctest_submit (PARTS Build) -endif () -ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) -if (${res} LESS 0 OR ${res} GREATER 0) - file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Tests: ${res}\n") -endif () -if (LOCAL_SUBMIT) - ctest_submit (PARTS Test) -endif () -if (${res} LESS 0 OR ${res} GREATER 0) - message (FATAL_ERROR "tests FAILED") -endif () -#----------------------------------------------------------------------------- -############################################################################################################## -message (STATUS "DONE") diff --git a/config/cmake/README.txt.cmake.in b/config/cmake/README.txt.cmake.in index be6ddc1..b29d50b 100644 --- a/config/cmake/README.txt.cmake.in +++ b/config/cmake/README.txt.cmake.in @@ -34,9 +34,9 @@ utility should be installed. To test the installation with the examples; Create a directory to run the examples. Copy HDF5Examples folder to this directory. + Copy CTestScript.cmake to this directory. Copy HDF5_Examples.cmake to this directory. Copy HDF5_Examples_options.cmake to this directory. - Copy CTestScript.cmake to this directory. The default source folder is defined as "HDF5Examples". It can be changed with the CTEST_SOURCE_NAME script option. The default installation folder is defined as "@CMAKE_INSTALL_PREFIX@". diff --git a/release_docs/USING_CMake_Examples.txt b/release_docs/USING_CMake_Examples.txt index ea1ac05..ea352fe 100644 --- a/release_docs/USING_CMake_Examples.txt +++ b/release_docs/USING_CMake_Examples.txt @@ -38,12 +38,14 @@ II. Building HDF5 Examples with CMake Files in the HDF5 install directory: HDF5Examples folder + CTestScript.cmake HDF5_Examples.cmake HDF5_Examples_options.cmake Default installation process: Create a directory to run the examples, i.e. \test_hdf5. Copy HDF5Examples folder to this directory. + Copy CTestScript.cmake to this directory. Copy HDF5_Examples.cmake to this directory. Copy HDF5_Examples_options.cmake to this directory. The default source folder is defined as "HDF5Examples". It can be changed -- cgit v0.12 From 8a09caf90ad6c1492db1ef8110abd9703955674c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 2 Apr 2019 12:30:16 -0500 Subject: Add namespace option to dependencies --- CMakeInstallation.cmake | 4 +- CMakeLists.txt | 2 +- config/cmake/cacheinit.cmake | 2 + config/cmake/hdf5-config.cmake.in | 4 +- config/cmake_ext_mod/HDFLibMacros.cmake | 122 ++++++++++---------------------- 5 files changed, 44 insertions(+), 90 deletions(-) diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 7cf3450..b933c29 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -33,7 +33,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) EXPORT ${HDF5_EXPORTED_TARGETS} DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/hdf5 FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake - NAMESPACE ${HDF5_PACKAGE}:: + NAMESPACE ${HDF_PACKAGE_NAMESPACE} COMPONENT configinstall ) endif () @@ -45,7 +45,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) export ( TARGETS ${HDF5_LIBRARIES_TO_EXPORT} ${HDF5_LIB_DEPENDENCIES} ${HDF5_UTILS_TO_EXPORT} FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake - NAMESPACE ${HDF5_PACKAGE}:: + NAMESPACE ${HDF_PACKAGE_NAMESPACE} ) endif () endif () diff --git a/CMakeLists.txt b/CMakeLists.txt index c95ae64..f1489c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -756,7 +756,7 @@ endif () option (BUILD_TESTING "Build HDF5 Unit Testing" ON) if (BUILD_TESTING) set (DART_TESTING_TIMEOUT 1200 - CACHE INTEGER + CACHE STRING "Timeout in seconds for each test (default 1200=20minutes)" ) diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index d5c5e52..3bac02e 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -19,6 +19,8 @@ set (CMAKE_INSTALL_FRAMEWORK_PREFIX "Library/Frameworks" CACHE STRING "Framework set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) +set (HDF_PACKAGE_NAMESPACE "hdf5::" CACHE STRING "Name for HDF package namespace" FORCE) + set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) set (HDF5_BUILD_GENERATORS ON CACHE BOOL "Build Test Generators" FORCE) diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in index b1ef0ac..d0f1d00 100644 --- a/config/cmake/hdf5-config.cmake.in +++ b/config/cmake/hdf5-config.cmake.in @@ -108,10 +108,10 @@ set (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@) # project which has already built hdf5 as a subproject #----------------------------------------------------------------------------- if (NOT TARGET "@HDF5_PACKAGE@") - if (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS AND NOT TARGET "zlib") + if (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS) include (@PACKAGE_SHARE_INSTALL_DIR@/@ZLIB_PACKAGE_NAME@/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) endif () - if (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS AND NOT TARGET "szip") + if (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS) include (@PACKAGE_SHARE_INSTALL_DIR@/@SZIP_PACKAGE_NAME@/@SZIP_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) endif () include (@PACKAGE_SHARE_INSTALL_DIR@/@HDF5_PACKAGE@/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake) diff --git a/config/cmake_ext_mod/HDFLibMacros.cmake b/config/cmake_ext_mod/HDFLibMacros.cmake index 2eda66c..9df2b4b 100644 --- a/config/cmake_ext_mod/HDFLibMacros.cmake +++ b/config/cmake_ext_mod/HDFLibMacros.cmake @@ -14,25 +14,7 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) # May need to build JPEG with PIC on x64 machines with gcc # Need to use CMAKE_ANSI_CFLAGS define so that compiler test works - if (${compress_type} MATCHES "SVN") - EXTERNALPROJECT_ADD (JPEG - SVN_REPOSITORY ${JPEG_URL} - # [SVN_REVISION rev] - INSTALL_COMMAND "" - CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} - -DJPEG_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} - -DJPEG_EXTERNALLY_CONFIGURED:BOOL=OFF - -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} - -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} - -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} - -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} - -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} - -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} - -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} - ) - elseif (${compress_type} MATCHES "GIT") + if (${compress_type} MATCHES "GIT") EXTERNALPROJECT_ADD (JPEG GIT_REPOSITORY ${JPEG_URL} GIT_TAG ${JPEG_BRANCH} @@ -49,6 +31,7 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} + -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE} ) elseif (${compress_type} MATCHES "TGZ") EXTERNALPROJECT_ADD (JPEG @@ -67,23 +50,24 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} + -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE} ) endif () externalproject_get_property (JPEG BINARY_DIR SOURCE_DIR) ##include (${BINARY_DIR}/${JPEG_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) # Create imported target jpeg-static - add_library(jpeg-static STATIC IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (jpeg-static "jpeg" STATIC "") - add_dependencies (jpeg-static JPEG) - set (JPEG_STATIC_LIBRARY "jpeg-static") + add_library(${HDF_PACKAGE_NAMESPACE}jpeg-static STATIC IMPORTED) + HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}jpeg-static "jpeg" STATIC "") + add_dependencies (${HDF_PACKAGE_NAMESPACE}jpeg-static JPEG) + set (JPEG_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}jpeg-static") set (JPEG_LIBRARIES ${JPEG_STATIC_LIBRARY}) if (BUILD_SHARED_LIBS) # Create imported target jpeg-shared - add_library(jpeg-shared SHARED IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (jpeg-shared "jpeg" SHARED "") - add_dependencies (jpeg-shared JPEG) - set (JPEG_SHARED_LIBRARY "jpeg-shared") + add_library(${HDF_PACKAGE_NAMESPACE}jpeg-shared SHARED IMPORTED) + HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}jpeg-shared "jpeg" SHARED "") + add_dependencies (${HDF_PACKAGE_NAMESPACE}jpeg-shared JPEG) + set (JPEG_SHARED_LIBRARY "${HDF_PACKAGE_NAMESPACE}jpeg-shared") set (JPEG_LIBRARIES ${JPEG_LIBRARIES} ${JPEG_SHARED_LIBRARY}) endif () @@ -100,33 +84,14 @@ macro (PACKAGE_JPEG_LIBRARY compress_type) COMMENT "Copying ${JPEG_INCLUDE_DIR_GEN}/jconfig.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" ) set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/jconfig.h) - if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "TGZ") add_dependencies (JPEG-GenHeader-Copy JPEG) endif () endmacro () #------------------------------------------------------------------------------- macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) - if (${compress_type} MATCHES "SVN") - EXTERNALPROJECT_ADD (SZIP - SVN_REPOSITORY ${SZIP_URL} - # [SVN_REVISION rev] - INSTALL_COMMAND "" - CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} - -DSZIP_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} - -DSZIP_EXTERNALLY_CONFIGURED:BOOL=OFF - -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} - -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} - -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} - -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} - -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} - -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} - -DSZIP_ENABLE_ENCODING:BOOL=${encoding} - -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} - ) - elseif (${compress_type} MATCHES "GIT") + if (${compress_type} MATCHES "GIT") EXTERNALPROJECT_ADD (SZIP GIT_REPOSITORY ${SZIP_URL} GIT_TAG ${SZIP_BRANCH} @@ -144,6 +109,7 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DSZIP_ENABLE_ENCODING:BOOL=${encoding} -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} + -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE} ) elseif (${compress_type} MATCHES "TGZ") EXTERNALPROJECT_ADD (SZIP @@ -163,23 +129,24 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DSZIP_ENABLE_ENCODING:BOOL=${encoding} -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} + -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE} ) endif () externalproject_get_property (SZIP BINARY_DIR SOURCE_DIR) ##include (${BINARY_DIR}/${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) # Create imported target szip-static - add_library(szip-static STATIC IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (szip-static "szip" STATIC "") - add_dependencies (szip-static SZIP) - set (SZIP_STATIC_LIBRARY "szip-static") + add_library(${HDF_PACKAGE_NAMESPACE}szip-static STATIC IMPORTED) + HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}szip-static "szip" STATIC "") + add_dependencies (${HDF_PACKAGE_NAMESPACE}szip-static SZIP) + set (SZIP_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}szip-static") set (SZIP_LIBRARIES ${SZIP_STATIC_LIBRARY}) if (BUILD_SHARED_LIBS) # Create imported target szip-shared - add_library(szip-shared SHARED IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (szip-shared "szip" SHARED "") - add_dependencies (szip-shared SZIP) - set (SZIP_SHARED_LIBRARY "szip-shared") + add_library(${HDF_PACKAGE_NAMESPACE}szip-shared SHARED IMPORTED) + HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}szip-shared "szip" SHARED "") + add_dependencies (${HDF_PACKAGE_NAMESPACE}szip-shared SZIP) + set (SZIP_SHARED_LIBRARY "${HDF_PACKAGE_NAMESPACE}szip-shared") set (SZIP_LIBRARIES ${SZIP_LIBRARIES} ${SZIP_SHARED_LIBRARY}) endif () @@ -196,32 +163,14 @@ macro (PACKAGE_SZIP_LIBRARY compress_type) COMMENT "Copying ${SZIP_INCLUDE_DIR_GEN}/SZconfig.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" ) set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/SZconfig.h) - if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "TGZ") add_dependencies (SZIP-GenHeader-Copy SZIP) endif () endmacro () #------------------------------------------------------------------------------- macro (EXTERNAL_ZLIB_LIBRARY compress_type) - if (${compress_type} MATCHES "SVN") - EXTERNALPROJECT_ADD (ZLIB - SVN_REPOSITORY ${ZLIB_URL} - # [SVN_REVISION rev] - INSTALL_COMMAND "" - CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} - -DZLIB_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} - -DZLIB_EXTERNALLY_CONFIGURED:BOOL=OFF - -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} - -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} - -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} - -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} - -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} - -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} - -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} - ) - elseif (${compress_type} MATCHES "GIT") + if (${compress_type} MATCHES "GIT") EXTERNALPROJECT_ADD (ZLIB GIT_REPOSITORY ${ZLIB_URL} GIT_TAG ${ZLIB_BRANCH} @@ -238,6 +187,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} + -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE} ) elseif (${compress_type} MATCHES "TGZ") EXTERNALPROJECT_ADD (ZLIB @@ -256,6 +206,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} + -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE} ) endif () externalproject_get_property (ZLIB BINARY_DIR SOURCE_DIR) @@ -267,17 +218,18 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) endif () ##include (${BINARY_DIR}/${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) # Create imported target zlib-static - add_library(zlib-static STATIC IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (zlib-static ${ZLIB_LIB_NAME} STATIC "") - add_dependencies (zlib-static ZLIB) - set (ZLIB_STATIC_LIBRARY "zlib-static") + add_library(${HDF_PACKAGE_NAMESPACE}zlib-static STATIC IMPORTED) +# add_library(${HDF_PACKAGE_NAMESPACE}zlib-static ALIAS zlib-static) + HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}zlib-static ${ZLIB_LIB_NAME} STATIC "") + add_dependencies (${HDF_PACKAGE_NAMESPACE}zlib-static ZLIB) + set (ZLIB_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}zlib-static") set (ZLIB_LIBRARIES ${ZLIB_STATIC_LIBRARY}) if (BUILD_SHARED_LIBS) # Create imported target zlib-shared - add_library(zlib-shared SHARED IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (zlib-shared ${ZLIB_LIB_NAME} SHARED "") - add_dependencies (zlib-shared ZLIB) - set (ZLIB_SHARED_LIBRARY "zlib-shared") + add_library(${HDF_PACKAGE_NAMESPACE}zlib-shared SHARED IMPORTED) + HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}zlib-shared ${ZLIB_LIB_NAME} SHARED "") + add_dependencies (${HDF_PACKAGE_NAMESPACE}zlib-shared ZLIB) + set (ZLIB_SHARED_LIBRARY "${HDF_PACKAGE_NAMESPACE}zlib-shared") set (ZLIB_LIBRARIES ${ZLIB_LIBRARIES} ${ZLIB_SHARED_LIBRARY}) endif () @@ -294,7 +246,7 @@ macro (PACKAGE_ZLIB_LIBRARY compress_type) COMMENT "Copying ${ZLIB_INCLUDE_DIR_GEN}/zconf.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" ) set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/zconf.h) - if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "TGZ") add_dependencies (ZLIB-GenHeader-Copy ZLIB) endif () endmacro () -- cgit v0.12 From cab705c8cba3d140335a3b86524f23d5cd929b65 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 2 Apr 2019 12:57:02 -0500 Subject: Update for namespace --- config/cmake/mccacheinit.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/cmake/mccacheinit.cmake b/config/cmake/mccacheinit.cmake index 577144b..c35f51f 100644 --- a/config/cmake/mccacheinit.cmake +++ b/config/cmake/mccacheinit.cmake @@ -23,6 +23,8 @@ set (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE) set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) +set (HDF_PACKAGE_NAMESPACE "hdf5::" CACHE STRING "Name for HDF package namespace" FORCE) + set (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE) set (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE) -- cgit v0.12 From bd2317cc11071f91e41f7229585173e956129932 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 3 Apr 2019 08:52:28 -0500 Subject: Add help info --- config/cmake/cacheinit.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index 3bac02e..5254115 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -19,7 +19,7 @@ set (CMAKE_INSTALL_FRAMEWORK_PREFIX "Library/Frameworks" CACHE STRING "Framework set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) -set (HDF_PACKAGE_NAMESPACE "hdf5::" CACHE STRING "Name for HDF package namespace" FORCE) +set (HDF_PACKAGE_NAMESPACE "hdf5::" CACHE STRING "Name for HDF package namespace (can be empty)" FORCE) set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) -- cgit v0.12