summaryrefslogtreecommitdiffstats
path: root/config/cmake_ext_mod
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2021-02-08 16:56:16 (GMT)
committerGitHub <noreply@github.com>2021-02-08 16:56:16 (GMT)
commit22c67ff6570f16050f0a5654cf1c84df917bb598 (patch)
tree38fb63aa498b250c2543fe7e22a511706de96a42 /config/cmake_ext_mod
parent551f15f8ae02ca9c995619b216121081eb07633e (diff)
downloadhdf5-hdf5-1_8_22.zip
hdf5-hdf5-1_8_22.tar.gz
hdf5-hdf5-1_8_22.tar.bz2
1.8/master (#317)hdf5-1_8_22
* Revert incorrect bool type * Correct grep text for filter test * Check sizeof type to use correct ref_type * h5dump reg ref chnages has no error file * Fix comment * Remove unneeded files * Verify the decoded version for "all" and "none" selection. * Remove double entry * Add missing include * Snapshot version 1.8 release 22 (snap4) Update version to 1.8-snap5 * Fixes for test failures with --disable-tests --disable-tools options. Don't test ph5diff if tests are disabled. * Correct conditions for parallel builds with and without tests. * Snapshot version 1.8 release 22 (snap5) Update version to 1.8.22-snap6 * TRILAB-192 merging warnings changes from develop * Autotools reconfigure update * Restore page ejects. * Restore page eject chars * Fix orphaned token * Update LT files * Correct extra flags and merge TRILAB-24 * Update release note for CMake warnings * H5repack bug fixes from develop * TRILAB-192 - merge changes from develop Single source, config files, for warnings for both autotools and CMake. Update CMake libraries, tools, tests to use correct flags. * Add missing m4 file * Remove 128bit config check fo 1.8 * TRILAB-192 update LTparse files * A fix in the cleaning up code for datatype when datatype initialization via H5D__init_type() fails. The code to fix the problem is the same as what is done in H5D__open_oid(). * Add missing " and update function calls incorrectly named load_gcc_arguments. Commit changes to gnu-cxxflags to remove unmatched " and to gnu-fflags to not add C warnings flags to H5_FCFLAGS. * TRILAB-192 - cleanup edits and match CMake CXX to autotools * Fix shadowed type * TRILAB-192 correct fortran commands * TRILAB-192 version of std=f2008 special check * Fix shadow variable * Add prefix_relto_examplesdir function to set relative path to h5c++. * TRILAB-192 - parser files cannot handle this warning * Parallel Fortran tests now use the MPI module instead of including mpif.h. * Don't add general warnings flags for unsupported old versions of gcc and g++ (older than gcc/g++ 4.2). Correct gnu-cxxflags to determine warnings flags to be added based on C++ compiler version instead of C compiler version. * Snapshot version 1.8 release 22 (snap6) Update version to 1.8.22-snap7 * TRILAB-244 separate CXX warnings and errors from C * Fix NoFilter build * Move ADD_H5_FLAGS macro from *CompilerFlags.cmake files to config/cmake_ext_mod/HDFMacros.cmake for common use. * Restrict errors to gcc 4.8 and above. * OESS-65 replace szip with aec szip * Correct CMake version * Correct -Werror=unused-variable * Add -Werror= flags to lists displayed in libhdf5.settings. * Fix -Werror=unused-variable * More fixes for unused variable * Resolve warning errors from -Werror= flags: -Werror=bad-function-cast -Werror=bad-function-cast -Werror=implicit-function-declaration -Werror=nested-externs * Remove verbose assignments in smoke_check 3 and 5 functions. * Update to use optimization flags, C++ error flags, and correct libhdf5.settings.in to remove unworkable changes. * Update config/gnu-cxxflags. * Add missing headers * Fix ifort warning flag. Restore AC_DEFUN([PAC_PROG_FC_DEFAULT_REALisDBLE] in m4/aclocal_fc.m4. Add --enable-symbols, --enable-profiling, and --enable-optimization options to autotools configure; all configure flags for --enable-production and --disable-production should match HDF5 1.10 and 1.12 production and debug default flags. * Add github actions file * Correct path * OESS-65 Fix packaging * Update reference name * Correct filename * disable pr action and enable fail fast * Snapshot 1.8.22-snap7 Update version to 1.8.22-snap8. * Correct mingw path * Correct mingw paths * Revise gnu-*flags and cmake/HDF*CompilerFlags.cmake files to add warning flags for GCC compilers version 4.8 and above. Removed files from gnu-warnings that only apply to versions < 4.8. Consolidated warnings from versions < 4.8 that apply to versions >= 4.8 into the 4.8 warnings files. * Update MANIFEST for removal of older warnings files. * Yanked all MPI-1 calls Added batch scripts in bin/batch. * Snapshot 1.8.22-snap8. Update version to 1.8.22-snap9. * Squashed commit of the following: commit 45b0cbc71929930a874e1c09e0770aa64d0ae697 Author: Larry Knox <lrknox@hdfgroup.org> Date: Thu Apr 23 13:14:56 2020 -0500 Add C++ warnings treated as error for autotools builds. commit 6debcddcc766601799d5bd661bd60946f951a07e Author: Larry Knox <lrknox@hdfgroup.org> Date: Fri Jun 19 16:50:03 2020 -0500 Remove tests for develop branch from testh5cc.sh.in. Add @H5_ECXXFLAGS@ to AM_CXXFLAGS. commit fed497e7f207313b2a133d3b68c942b7d7104b90 Author: Larry Knox <lrknox@hdfgroup.org> Date: Fri Jun 12 15:06:39 2020 -0500 Merge pull request #2646 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:develop to develop * commit '998c6470d78e14228695419c3b514c35ecf3d69e': Remove unnecessary version conditions for Clang compilers. commit 92e52ce5c211bd1d3991a3b8bb67287ac7b652aa Author: Larry Knox <lrknox@hdfgroup.org> Date: Wed Jun 10 18:53:45 2020 -0500 Merge pull request #2639 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:develop to develop * commit 'a33667faf226f5d8c9633bf537893e8fce1bf1f6': Add c++ to --enable-sanitize-checks option. commit 2e802534fb997b81fa98fdd1c7d97d4310898e0d Author: Larry Knox <lrknox@hdfgroup.org> Date: Wed Jun 10 15:18:36 2020 -0500 Merge pull request #2633 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:develop to develop * commit '20eab963899841c9a003baebead8e3bc07d9e127': Remove duplicate entries in MANIFEST. Make changes to CMake CompilerFlags.cmake files so extra flags are loaded for non-GNU compilers. Update new clang files to not pick up clang as vendor for pgCC. Add new files to MANIFEST Temporary demotion of 2 -Werror warning flags that fail on macos 10.12 Remove Production flag unknown to Apple clang. commit 96ef60a58a23847a7da89a891f2415055ec2ab60 Author: Larry Knox <lrknox@hdfgroup.org> Date: Mon Jun 8 16:24:49 2020 -0500 Merge pull request #2631 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:develop to develop * commit 'b942a4d8a3e27317cac50ce37ff5302d477664d8': Clean up code to get clang version in config/linux-gnulibc1 commit 8a7c687da568e8b50b38fa53da1ca63759be6ec4 Author: Larry Knox <lrknox@hdfgroup.org> Date: Mon Jun 8 11:42:37 2020 -0500 Merge pull request #2623 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:develop to develop * commit 'c7626f79fdee4eee13925e240ef41e61f3367eab': Add flags from config/clang-warnings/*general files to H5 C and CXX flags for all versions of Clang and Clang++ compilers. Switched from cut to awk in testcheck_version.sh.in to avoid dependence on tab vs. " " in version definitions in H5public.h. Add files for adding warning flags for clang compilers in autotools configure. commit db3ef7ff3c1ed79167cecef831501411cff8291f Merge: 5a0f8d7 f9f1310 Author: Larry Knox <lrknox@hdfgroup.org> Date: Fri Jun 19 14:46:22 2020 -0500 Merge branch 'hdf5_1_12' of https://bitbucket.hdfgroup.org/scm/~lrknox/hdf5_lrk into hdf5_1_12 commit 5a0f8d7940ae57b445f545a0abd7e303ce6924ee Author: Larry Knox <lrknox@hdfgroup.org> Date: Wed Jun 10 20:15:41 2020 -0500 Merge pull request #2636 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:HDFFV-11000-update-testh5cc.sh.in-for-version to develop * commit '5c0bd670d6e9919c463fbc05de99e2ba55b0761e': Add tests for all version to H5_NO_DEPRECATED_SYMBOLS section and to section for current version, with and without default API version flags. HDFFV-11000: update-testh5cc.sh.in to test sample versioned functions in HDF5 1.10, 1.12 and develop. * Update configure and Makefile.ins after bin/reconfigure. * Fix MANIFEST * Fix HDFFV-10591 Description: h52gif produced a segfault when a buffer overflow occurred because the data size was corrupted and became very large. This commit added a check on the data size against the buffer size to prevent the segfault. It also added error reporting to h52gif to display an error message instead of silently exiting when the failure occurred. Platforms tested: Linux/64 (jelly) * Snapshot 1.8.22-snap9. Update version to 1.8.22-snap10. * Merge pull request #2686 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:develop to develop * commit '800f93f7c994f88dfa716746153ded4b1e690e3a': Remove path to szip header file from AM_CPPFLAGS when configure check of libsz fails. Fix for HDFFV-10830. * Regenerate configure. * Merge from 1.10-1.12-dev - LT parse needs update * Incorporate pull request #2693 from develop for the fix to HDFFV-11080: (1) Patch up the file pointer when reading attribute of variable length datatype (2) Test to verify the fix when doing multiple threads (3) Update MANIFEST (4) Add new test to Cmake * Switch bison and flex update of LT files from bin/genltanalyse to bin/genparser, and from automatically updating the LT files whenever reconfigure is run to running only on man<F12>ual command. * Update hl/sr/H5LT files. Add bin/genparser to MANIFEST; remove bin/genltanalyze. * Fix to the merge of PR #2708 for HDFFV-11080 to the 1.8 branch. Need to checkin test/Makefile.in for the new file added. * Fix HDFFV-11120 and HDFFV-11121 (CVE-2018-13870 and CVE-2018-13869) Description: When a buffer overflow occurred because a name length was corrupted and became very large, h5dump produced a segfault on one file and a memcpy parameter overlap on another file. This commit added checks that detect a read pass the end of the buffer to prevent these error conditions. Platforms tested: Linux/64 (jelly) * Fixed typo * Check for header szlib.h only when libsz passes AC_CHECK_LIB, so that H5_HAVE_SALIB_H is not defined when szip is not enabled, to prevent compile failures for incompatible szlib. * HDFFV-11127 - force RTLD_LOCAL in dlopen * spelling * Remove extra parens * Remove unnecessary assignment freom configure.ac. * Add hypen to subrelease regex * Add special case when H5_VERS_SUBRELEASE is 0 * Revert H5_VERS_SUBRELEASE check * The version string has a second use for packaging * MinGW uses "MinGW Makefiles" * Snapshot 1.8.22-snap10. Update version to 1.8.22-snap11. * Merge clang-format changes from develop * remove stray file * Source formatted * Add options to github actions. * Add back file, remove py file * HDFFV-11096 Correct h5dump usage text * Update formating * remove autogen for 1.8 branch * Fix comment whitespace * Change '==' to 'eq' in test script * Merge from develop github updates bin scripts parser updates * Snapshot 1.8.22-snap11. Update version to 1.8.22-snap12. * Merge from 1.10 Comments, whitespace Simple init and if block brackets. Minimal code changes limited to return value and spelling * Update autotools files * Update FD source * More merges from 1.10 comments and inits * Comment fixes * Fix macro argument * Remove autogen file and cache dir * Revert autotools files to previous version * Correct boolean value and missing define * URL and options corrections * revert autoconf files * Fix compile issues with vfd drivers. * Fix HDFS test * Remove extra #endif * Move init above execution * Multiple changes to bring branch up-to-date (#87) Correct TARGET variable and CMake config file location. Add option to allow filter plugins to be built inline. Update CMake tools macros. * hdf5 1 8 release text (#113) * Multiple changes to bring branch up-to-date Correct TARGET variable and CMake config file location. Add option to allow filter plugins to be built inline. Update CMake tools macros. * release text updates - mostly whitespace * Fixed HDFFV-10480 and HDFFV-11159 (#145) * Fixed HDFFV-10480 and HDFFV-11159 Description Checked against buffer size to prevent segfault, in case of data corruption. + HDFFV-11159 CVE-2018-14033 Buffer over-read in H5O_layout_decode + HDFFV-10480 CVE-2018-11206 Buffer over-read in H5O_fill_new[/old]_decode and A user's patch was applied to this previously, but it is redone for a more correct fix, that is the check now accounted for the previous advance of the buffer pointer. Platforms tested: Linux/64 (jelly) * Fixed typo * Update HDF5 1.8 copyright headers with updated copyright URL (#148) * Update URL for COPYING file in copyright headers. * Make fortran copyright headers uniformly spaced. * Update url for Copyright file in c++/src/footer.html. * OESS-98 Update plugin build option (#171) * 1.8 has extra fortran CMake option (#176) * 1.8 has extra fortran CMake option * Update license URL * OESS-98 fix tools test for plugins (#180) * Hdf5 1 8 (#169) * Fixed HDFFV-10480 and HDFFV-11159 Description Checked against buffer size to prevent segfault, in case of data corruption. + HDFFV-11159 CVE-2018-14033 Buffer over-read in H5O_layout_decode + HDFFV-10480 CVE-2018-11206 Buffer over-read in H5O_fill_new[/old]_decode and A user's patch was applied to this previously, but it is redone for a more correct fix, that is the check now accounted for the previous advance of the buffer pointer. Platforms tested: Linux/64 (jelly) * Fixed typo * Fixed HDFFV-11150 Description Replaced an HDassert with a check for null pointer in H5O_dec_rc() to catch null pointer in corrupted data situation. Reversed the fix in svn-r24463 in which a check for null pointer prior to calling H5O_dec_rc() Platforms tested: Linux/64 (jelly) * HDF5 1 8 fix fortran build on macs (#186) * Correct fortran and shared libs option * Fix for no shared fortran build * OESS-98 fix hdf5 link target (#191) * Partial changes to RELEASE.txt for release. (#185) * Partial changes to RELEASE.txt for release. * Update supported and tested platforms. * Update version to 1.8.22-12. * close #195. (#196) * Update HDF5PluginMacros.cmake * Update HDF5PluginMacros.cmake * Update directory for SZ filter in HDF5PluginMacros.cmake. Updates for release: Switch configure default to production mode. Set HDF5_GENERATE_HEADERS to OFF. * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Restores maintainer mode in the autotools (#200) (#203) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> * Hdf5 1 8 22 (#212) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Brings ttsafe_attr_vlen.c changes from develop (#214) Fixes exposed pthread problem on Windows. * Update SO numbers for Hdf5 1 8 22 (#215) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Hdf5 1 8 22 (#224) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> * Update CMake/HDF5Examples version in bin/release * Update CMake/HDF5Examples version number in bin/release (#225) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> * Fixed typo in an error message. (#228) * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * Bring 3 small changes from Hdf5 1.8 to 1.8.22 (#241) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * Stat st blocks fix 1822 (#251) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * Fixes Autotools detection of the st_blocks field in stat (#246) * Fixes Autotools detection of the st_blocks field in stat The Autotools and CMake will now both correctly determine if the stat struct has the st_blocks field and set H5_HAVE_STAT_ST_BLOCKS appropriately. * Fixes a typo in configure.ac * Restore lines in RELEASE.txt. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * Stat st blocks fix 1822 (#256) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * Fixes Autotools detection of the st_blocks field in stat (#246) * Fixes Autotools detection of the st_blocks field in stat The Autotools and CMake will now both correctly determine if the stat struct has the st_blocks field and set H5_HAVE_STAT_ST_BLOCKS appropriately. * Fixes a typo in configure.ac * Restore lines in RELEASE.txt. * Updated configure with reconfigure. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * RELEASE.txt cleanup. * Hdf5 1 8 22 (#261) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * RELEASE.txt cleanup. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * Add macOS Big Sur to tested machines, also missing entries for macOS 10.13 and 10.14. * )Update version. * Hdf5 1 8 22 (#266) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * RELEASE.txt cleanup. * Add macOS Big Sur to tested machines, also missing entries for macOS 10.13 and 10.14. * )Update version. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * Reverts lock/unlock callback signature to 1.8.21 version (#254) * Reverts lock/unlock callback signature to 1.8.21 version This callback is unused in 1.8. The ros3 and hdfs VFDs are the only VFDs that have the lock callback implemented and that is just as no-op stubs. These stubs were removed so the callbacks are now NULL pointers, like the other VFDs in 1.8. * Trivial whitespace fix * Update version to 1.8.22-14. * Hdf5 1 8 22 - Reverts lock/unlock callback signature to 1.8.21 version (#267) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * RELEASE.txt cleanup. * Add macOS Big Sur to tested machines, also missing entries for macOS 10.13 and 10.14. * )Update version. * Reverts lock/unlock callback signature to 1.8.21 version (#254) * Reverts lock/unlock callback signature to 1.8.21 version This callback is unused in 1.8. The ros3 and hdfs VFDs are the only VFDs that have the lock callback implemented and that is just as no-op stubs. These stubs were removed so the callbacks are now NULL pointers, like the other VFDs in 1.8. * Trivial whitespace fix * Update version to 1.8.22-14. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * Update version in H5public.h * Hdf5 1 8 22 (#269) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * RELEASE.txt cleanup. * Add macOS Big Sur to tested machines, also missing entries for macOS 10.13 and 10.14. * )Update version. * Reverts lock/unlock callback signature to 1.8.21 version (#254) * Reverts lock/unlock callback signature to 1.8.21 version This callback is unused in 1.8. The ros3 and hdfs VFDs are the only VFDs that have the lock callback implemented and that is just as no-op stubs. These stubs were removed so the callbacks are now NULL pointers, like the other VFDs in 1.8. * Trivial whitespace fix * Update version to 1.8.22-14. * Update version in H5public.h Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * Set version 1.8.22 for release. * dd RELEASE.txt entry for HDFFV-10741. * Hdf5 1 8 22 (#279) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * RELEASE.txt cleanup. * Add macOS Big Sur to tested machines, also missing entries for macOS 10.13 and 10.14. * )Update version. * Reverts lock/unlock callback signature to 1.8.21 version (#254) * Reverts lock/unlock callback signature to 1.8.21 version This callback is unused in 1.8. The ros3 and hdfs VFDs are the only VFDs that have the lock callback implemented and that is just as no-op stubs. These stubs were removed so the callbacks are now NULL pointers, like the other VFDs in 1.8. * Trivial whitespace fix * Update version to 1.8.22-14. * Update version in H5public.h * Set version 1.8.22 for release. * dd RELEASE.txt entry for HDFFV-10741. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * Improve performance of multiple calls to H5Sget_select_elem_pointlist (#270) (#277) * Cache the pointer to the next point to process after the last call to H5S__get_select_elem_pointlist. This allows the normal process of iterating over the points in batches to be much more efficient, as the library does not need to traverse the entirety of the preceding points every time the funciton is re-entered. * Update RELEASE.txt for point selection iteration performance fix. * Hdf5 1 8 22 (#281) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * RELEASE.txt cleanup. * Add macOS Big Sur to tested machines, also missing entries for macOS 10.13 and 10.14. * )Update version. * Reverts lock/unlock callback signature to 1.8.21 version (#254) * Reverts lock/unlock callback signature to 1.8.21 version This callback is unused in 1.8. The ros3 and hdfs VFDs are the only VFDs that have the lock callback implemented and that is just as no-op stubs. These stubs were removed so the callbacks are now NULL pointers, like the other VFDs in 1.8. * Trivial whitespace fix * Update version to 1.8.22-14. * Update version in H5public.h * Set version 1.8.22 for release. * dd RELEASE.txt entry for HDFFV-10741. * Improve performance of multiple calls to H5Sget_select_elem_pointlist (#270) (#277) * Cache the pointer to the next point to process after the last call to H5S__get_select_elem_pointlist. This allows the normal process of iterating over the points in batches to be much more efficient, as the library does not need to traverse the entirety of the preceding points every time the funciton is re-entered. * Update RELEASE.txt for point selection iteration performance fix. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> Co-authored-by: Neil Fortner <nfortne2@hdfgroup.org> * Hdf5 1 8 22 (#284) * Fixed typo in an error message. * Updated for HDFFV-11150, HDFFV-10480, and HDFFV-11159 * Update "Support for New Platforms and Compilers" section in RELEASE.txt; add check_version workaround for binary compatibility to "Known Problems". * Add SUSE Linux to tested platforms. * Update numbers in config/lt_vers.am and run bin/reconfigure for so numbers. * Update version in 3 files missed by merge. Co-authored-by: Allen Byrne <byrn@hdfgroup.org> Co-authored-by: Vailin Choi <vchoi@hdfgroup.org> Co-authored-by: vchoi <vchoi@jelly.ad.hdfgroup.org> Co-authored-by: hdftest <hdftest@hdfgroup.org> Co-authored-by: Jordan Henderson <jhenderson@hdfgroup.org> Co-authored-by: Dana Robinson <derobins@hdfgroup.org> Co-authored-by: Binh-Minh Ribler <bmribler@hdfgroup.org> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> Co-authored-by: H. Joe Lee <hyoklee@hdfgroup.org> Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Neil Fortner <nfortne2@hdfgroup.org>
Diffstat (limited to 'config/cmake_ext_mod')
-rw-r--r--config/cmake_ext_mod/CTestCustom.cmake19
-rw-r--r--config/cmake_ext_mod/ConfigureChecks.cmake382
-rw-r--r--config/cmake_ext_mod/FindSZIP.cmake234
-rw-r--r--config/cmake_ext_mod/GetTimeOfDayTest.cpp2
-rw-r--r--config/cmake_ext_mod/HDFCXXTests.cpp2
-rw-r--r--config/cmake_ext_mod/HDFLibMacros.cmake161
-rw-r--r--config/cmake_ext_mod/HDFMacros.cmake229
-rw-r--r--config/cmake_ext_mod/HDFTests.c83
-rw-r--r--config/cmake_ext_mod/HDFUseCXX.cmake109
-rw-r--r--config/cmake_ext_mod/HDFUseFortran.cmake190
-rw-r--r--config/cmake_ext_mod/grepTest.cmake160
-rw-r--r--config/cmake_ext_mod/runTest.cmake305
12 files changed, 1002 insertions, 874 deletions
diff --git a/config/cmake_ext_mod/CTestCustom.cmake b/config/cmake_ext_mod/CTestCustom.cmake
index 025bce4..2d72e8d 100644
--- a/config/cmake_ext_mod/CTestCustom.cmake
+++ b/config/cmake_ext_mod/CTestCustom.cmake
@@ -1,16 +1,17 @@
set (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 3000)
-
+
set (CTEST_CUSTOM_WARNING_EXCEPTION
${CTEST_CUSTOM_WARNING_EXCEPTION}
- "note.*expected.*void.*but argument is of type.*volatile"
- "SZIP.src.*:[ \t]*warning"
- "jpeg.src.*:[ \t]*warning"
- "POSIX name for this item is deprecated"
- "disabling jobserver mode"
- "warning.*implicit declaration of function"
- "note: expanded from macro"
+ ".*note.*expected.*void.*but argument is of type.*volatile.*"
+ ".*src.SZIP.*:[ \t]*warning.*"
+ ".*src.ZLIB.*:[ \t]*warning.*"
+ ".*src.JPEG.*:[ \t]*warning.*"
+ ".*POSIX name for this item is deprecated.*"
+ ".*disabling jobserver mode.*"
+ ".*warning.*implicit declaration of function.*"
+ ".*note: expanded from macro.*"
)
-
+
set (CTEST_CUSTOM_MEMCHECK_IGNORE
${CTEST_CUSTOM_MEMCHECK_IGNORE}
)
diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake
index 3797768..c654702 100644
--- a/config/cmake_ext_mod/ConfigureChecks.cmake
+++ b/config/cmake_ext_mod/ConfigureChecks.cmake
@@ -5,7 +5,7 @@
# 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://support.hdfgroup.org/ftp/HDF5/releases.
+# 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.
#
@@ -14,17 +14,13 @@
#-----------------------------------------------------------------------------
include (CheckFunctionExists)
include (CheckIncludeFile)
-include (CheckIncludeFileCXX)
include (CheckIncludeFiles)
include (CheckLibraryExists)
include (CheckSymbolExists)
include (CheckTypeSize)
include (CheckVariableExists)
-include (CheckFortranFunctionExists)
include (TestBigEndian)
-if (CMAKE_CXX_COMPILER AND CMAKE_CXX_COMPILER_LOADED)
- include (TestForSTDNamespace)
-endif ()
+include (CheckStructHasMember)
#-----------------------------------------------------------------------------
# APPLE/Darwin setup
@@ -33,7 +29,7 @@ if (APPLE)
list (LENGTH CMAKE_OSX_ARCHITECTURES ARCH_LENGTH)
if (ARCH_LENGTH GREATER 1)
set (CMAKE_OSX_ARCHITECTURES "" CACHE STRING "" FORCE)
- message(FATAL_ERROR "Building Universal Binaries on OS X is NOT supported by the HDF5 project. This is"
+ message (FATAL_ERROR "Building Universal Binaries on OS X is NOT supported by the HDF5 project. This is"
"due to technical reasons. The best approach would be build each architecture in separate directories"
"and use the 'lipo' tool to combine them into a single executable or library. The 'CMAKE_OSX_ARCHITECTURES'"
"variable has been set to a blank value which will build the default architecture for this system.")
@@ -66,17 +62,18 @@ endmacro ()
# ----------------------------------------------------------------------
# WINDOWS Hard code Values
# ----------------------------------------------------------------------
-
set (WINDOWS)
-if (WIN32)
- if (MINGW)
- set (${HDF_PREFIX}_HAVE_MINGW 1)
- set (WINDOWS 1) # MinGW tries to imitate Windows
- set (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1")
- endif ()
- set (${HDF_PREFIX}_HAVE_WIN32_API 1)
- set (CMAKE_REQUIRED_LIBRARIES "ws2_32.lib;wsock32.lib")
- if (NOT UNIX AND NOT MINGW)
+
+if (MINGW)
+ set (${HDF_PREFIX}_HAVE_MINGW 1)
+ set (WINDOWS 1) # MinGW tries to imitate Windows
+ set (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1")
+ set (${HDF_PREFIX}_HAVE_WINSOCK2_H 1)
+ set (__USE_MINGW_ANSI_STDIO 1)
+endif ()
+
+if (WIN32 AND NOT MINGW)
+ if (NOT UNIX)
set (WINDOWS 1)
set (CMAKE_REQUIRED_FLAGS "/DWIN32_LEAN_AND_MEAN=1 /DNOGDI=1")
if (MSVC)
@@ -86,34 +83,102 @@ if (WIN32)
endif ()
if (WINDOWS)
- set (${HDF_PREFIX}_HAVE_STDDEF_H 1)
- set (${HDF_PREFIX}_HAVE_SYS_STAT_H 1)
- set (${HDF_PREFIX}_HAVE_SYS_TYPES_H 1)
+ set (HDF5_REQUIRED_LIBRARIES "ws2_32.lib;wsock32.lib")
+ set (${HDF_PREFIX}_HAVE_WIN32_API 1)
set (${HDF_PREFIX}_HAVE_LIBM 1)
set (${HDF_PREFIX}_HAVE_STRDUP 1)
set (${HDF_PREFIX}_HAVE_SYSTEM 1)
set (${HDF_PREFIX}_HAVE_LONGJMP 1)
if (NOT MINGW)
set (${HDF_PREFIX}_HAVE_GETHOSTNAME 1)
+ set (${HDF_PREFIX}_HAVE_FUNCTION 1)
endif ()
- if (NOT UNIX AND NOT CYGWIN AND NOT MINGW)
+ if (NOT UNIX AND NOT CYGWIN)
set (${HDF_PREFIX}_HAVE_GETCONSOLESCREENBUFFERINFO 1)
+ set (${HDF_PREFIX}_GETTIMEOFDAY_GIVES_TZ 1)
+ set (${HDF_PREFIX}_HAVE_TIMEZONE 1)
+ set (${HDF_PREFIX}_HAVE_GETTIMEOFDAY 1)
+ set (${HDF_PREFIX}_HAVE_LIBWS2_32 1)
+ set (${HDF_PREFIX}_HAVE_LIBWSOCK32 1)
endif ()
- set (${HDF_PREFIX}_HAVE_FUNCTION 1)
- set (${HDF_PREFIX}_GETTIMEOFDAY_GIVES_TZ 1)
- set (${HDF_PREFIX}_HAVE_TIMEZONE 1)
- set (${HDF_PREFIX}_HAVE_GETTIMEOFDAY 1)
- if (MINGW)
- set (${HDF_PREFIX}_HAVE_WINSOCK2_H 1)
- endif ()
- set (${HDF_PREFIX}_HAVE_LIBWS2_32 1)
- set (${HDF_PREFIX}_HAVE_LIBWSOCK32 1)
endif ()
# ----------------------------------------------------------------------
# END of WINDOWS Hard code Values
# ----------------------------------------------------------------------
+if (NOT WINDOWS)
+ TEST_BIG_ENDIAN (${HDF_PREFIX}_WORDS_BIGENDIAN)
+endif ()
+
+#-----------------------------------------------------------------------------
+# Check IF header file exists and add it to the list.
+#-----------------------------------------------------------------------------
+macro (CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE)
+ CHECK_INCLUDE_FILES ("${USE_INCLUDES};${FILE}" ${VARIABLE})
+ if (${VARIABLE})
+ set (USE_INCLUDES ${USE_INCLUDES} ${FILE})
+ endif ()
+endmacro ()
+
+#-----------------------------------------------------------------------------
+# Check for the existence of certain header files
+#-----------------------------------------------------------------------------
+CHECK_INCLUDE_FILE_CONCAT ("sys/file.h" ${HDF_PREFIX}_HAVE_SYS_FILE_H)
+CHECK_INCLUDE_FILE_CONCAT ("sys/ioctl.h" ${HDF_PREFIX}_HAVE_SYS_IOCTL_H)
+CHECK_INCLUDE_FILE_CONCAT ("sys/resource.h" ${HDF_PREFIX}_HAVE_SYS_RESOURCE_H)
+CHECK_INCLUDE_FILE_CONCAT ("sys/socket.h" ${HDF_PREFIX}_HAVE_SYS_SOCKET_H)
+CHECK_INCLUDE_FILE_CONCAT ("sys/stat.h" ${HDF_PREFIX}_HAVE_SYS_STAT_H)
+CHECK_INCLUDE_FILE_CONCAT ("sys/time.h" ${HDF_PREFIX}_HAVE_SYS_TIME_H)
+CHECK_INCLUDE_FILE_CONCAT ("sys/types.h" ${HDF_PREFIX}_HAVE_SYS_TYPES_H)
+CHECK_INCLUDE_FILE_CONCAT ("features.h" ${HDF_PREFIX}_HAVE_FEATURES_H)
+CHECK_INCLUDE_FILE_CONCAT ("dirent.h" ${HDF_PREFIX}_HAVE_DIRENT_H)
+CHECK_INCLUDE_FILE_CONCAT ("setjmp.h" ${HDF_PREFIX}_HAVE_SETJMP_H)
+CHECK_INCLUDE_FILE_CONCAT ("stddef.h" ${HDF_PREFIX}_HAVE_STDDEF_H)
+CHECK_INCLUDE_FILE_CONCAT ("stdint.h" ${HDF_PREFIX}_HAVE_STDINT_H)
+CHECK_INCLUDE_FILE_CONCAT ("unistd.h" ${HDF_PREFIX}_HAVE_UNISTD_H)
+
+# Darwin
+CHECK_INCLUDE_FILE_CONCAT ("mach/mach_time.h" ${HDF_PREFIX}_HAVE_MACH_MACH_TIME_H)
+
+# Windows
+CHECK_INCLUDE_FILE_CONCAT ("io.h" ${HDF_PREFIX}_HAVE_IO_H)
+if (NOT CYGWIN)
+ CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" ${HDF_PREFIX}_HAVE_WINSOCK2_H)
+endif ()
+CHECK_INCLUDE_FILE_CONCAT ("sys/timeb.h" ${HDF_PREFIX}_HAVE_SYS_TIMEB_H)
+
+if (CMAKE_SYSTEM_NAME MATCHES "OSF")
+ CHECK_INCLUDE_FILE_CONCAT ("sys/sysinfo.h" ${HDF_PREFIX}_HAVE_SYS_SYSINFO_H)
+ CHECK_INCLUDE_FILE_CONCAT ("sys/proc.h" ${HDF_PREFIX}_HAVE_SYS_PROC_H)
+else ()
+ set (${HDF_PREFIX}_HAVE_SYS_SYSINFO_H "" CACHE INTERNAL "" FORCE)
+ set (${HDF_PREFIX}_HAVE_SYS_PROC_H "" CACHE INTERNAL "" FORCE)
+endif ()
+
+CHECK_INCLUDE_FILE_CONCAT ("globus/common.h" ${HDF_PREFIX}_HAVE_GLOBUS_COMMON_H)
+CHECK_INCLUDE_FILE_CONCAT ("pdb.h" ${HDF_PREFIX}_HAVE_PDB_H)
+CHECK_INCLUDE_FILE_CONCAT ("pthread.h" ${HDF_PREFIX}_HAVE_PTHREAD_H)
+CHECK_INCLUDE_FILE_CONCAT ("srbclient.h" ${HDF_PREFIX}_HAVE_SRBCLIENT_H)
+CHECK_INCLUDE_FILE_CONCAT ("string.h" ${HDF_PREFIX}_HAVE_STRING_H)
+CHECK_INCLUDE_FILE_CONCAT ("strings.h" ${HDF_PREFIX}_HAVE_STRINGS_H)
+CHECK_INCLUDE_FILE_CONCAT ("stdlib.h" ${HDF_PREFIX}_HAVE_STDLIB_H)
+CHECK_INCLUDE_FILE_CONCAT ("memory.h" ${HDF_PREFIX}_HAVE_MEMORY_H)
+CHECK_INCLUDE_FILE_CONCAT ("dlfcn.h" ${HDF_PREFIX}_HAVE_DLFCN_H)
+CHECK_INCLUDE_FILE_CONCAT ("inttypes.h" ${HDF_PREFIX}_HAVE_INTTYPES_H)
+CHECK_INCLUDE_FILE_CONCAT ("netinet/in.h" ${HDF_PREFIX}_HAVE_NETINET_IN_H)
+# _Bool type support
+CHECK_INCLUDE_FILE_CONCAT (stdbool.h ${HDF_PREFIX}_HAVE_STDBOOL_H)
+
+## Check for non-standard extenstion quadmath.h
+
+CHECK_INCLUDE_FILES(quadmath.h C_HAVE_QUADMATH)
+if (${C_HAVE_QUADMATH})
+ set(${HDF_PREFIX}_HAVE_QUADMATH_H 1)
+else ()
+ set(${HDF_PREFIX}_HAVE_QUADMATH_H 0)
+endif ()
+
if (CYGWIN)
set (${HDF_PREFIX}_HAVE_LSEEK64 0)
endif ()
@@ -121,7 +186,7 @@ endif ()
#-----------------------------------------------------------------------------
# Check for the math library "m"
#-----------------------------------------------------------------------------
-if (NOT WINDOWS)
+if (MINGW OR NOT WINDOWS)
CHECK_LIBRARY_EXISTS_CONCAT ("m" ceil ${HDF_PREFIX}_HAVE_LIBM)
CHECK_LIBRARY_EXISTS_CONCAT ("dl" dlopen ${HDF_PREFIX}_HAVE_LIBDL)
CHECK_LIBRARY_EXISTS_CONCAT ("ws2_32" WSAStartup ${HDF_PREFIX}_HAVE_LIBWS2_32)
@@ -132,25 +197,17 @@ endif ()
CHECK_LIBRARY_EXISTS_CONCAT ("ucb" gethostname ${HDF_PREFIX}_HAVE_LIBUCB)
# For other tests to use the same libraries
-set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${LINK_LIBS})
+set (HDF5_REQUIRED_LIBRARIES ${HDF5_REQUIRED_LIBRARIES} ${LINK_LIBS})
set (USE_INCLUDES "")
if (WINDOWS)
set (USE_INCLUDES ${USE_INCLUDES} "windows.h")
endif ()
-if (NOT WINDOWS)
- TEST_BIG_ENDIAN (${HDF_PREFIX}_WORDS_BIGENDIAN)
-endif ()
-
# For other specific tests, use this MACRO.
macro (HDF_FUNCTION_TEST OTHER_TEST)
if (NOT DEFINED ${HDF_PREFIX}_${OTHER_TEST})
set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}")
- set (OTHER_TEST_ADD_LIBRARIES)
- if (CMAKE_REQUIRED_LIBRARIES)
- set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
- endif ()
foreach (def
HAVE_SYS_TIME_H
@@ -170,11 +227,11 @@ macro (HDF_FUNCTION_TEST OTHER_TEST)
endif ()
#message (STATUS "Performing ${OTHER_TEST}")
- TRY_COMPILE (${OTHER_TEST}
+ try_compile (${OTHER_TEST}
${CMAKE_BINARY_DIR}
${HDF_RESOURCES_EXT_DIR}/HDFTests.c
- CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
- "${OTHER_TEST_ADD_LIBRARIES}"
+ COMPILE_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS}"
+ LINK_LIBRARIES "${HDF5_REQUIRED_LIBRARIES}"
OUTPUT_VARIABLE OUTPUT
)
if (${OTHER_TEST})
@@ -197,74 +254,6 @@ endmacro ()
HDF_FUNCTION_TEST (STDC_HEADERS)
#-----------------------------------------------------------------------------
-# Check IF header file exists and add it to the list.
-#-----------------------------------------------------------------------------
-macro (CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE)
- CHECK_INCLUDE_FILES ("${USE_INCLUDES};${FILE}" ${VARIABLE})
- if (${VARIABLE})
- set (USE_INCLUDES ${USE_INCLUDES} ${FILE})
- endif ()
-endmacro ()
-
-#-----------------------------------------------------------------------------
-# Check for the existence of certain header files
-#-----------------------------------------------------------------------------
-CHECK_INCLUDE_FILE_CONCAT ("sys/file.h" ${HDF_PREFIX}_HAVE_SYS_FILE_H)
-CHECK_INCLUDE_FILE_CONCAT ("sys/ioctl.h" ${HDF_PREFIX}_HAVE_SYS_IOCTL_H)
-CHECK_INCLUDE_FILE_CONCAT ("sys/resource.h" ${HDF_PREFIX}_HAVE_SYS_RESOURCE_H)
-CHECK_INCLUDE_FILE_CONCAT ("sys/socket.h" ${HDF_PREFIX}_HAVE_SYS_SOCKET_H)
-CHECK_INCLUDE_FILE_CONCAT ("sys/stat.h" ${HDF_PREFIX}_HAVE_SYS_STAT_H)
-CHECK_INCLUDE_FILE_CONCAT ("sys/time.h" ${HDF_PREFIX}_HAVE_SYS_TIME_H)
-CHECK_INCLUDE_FILE_CONCAT ("sys/types.h" ${HDF_PREFIX}_HAVE_SYS_TYPES_H)
-CHECK_INCLUDE_FILE_CONCAT ("features.h" ${HDF_PREFIX}_HAVE_FEATURES_H)
-CHECK_INCLUDE_FILE_CONCAT ("dirent.h" ${HDF_PREFIX}_HAVE_DIRENT_H)
-CHECK_INCLUDE_FILE_CONCAT ("setjmp.h" ${HDF_PREFIX}_HAVE_SETJMP_H)
-CHECK_INCLUDE_FILE_CONCAT ("stddef.h" ${HDF_PREFIX}_HAVE_STDDEF_H)
-CHECK_INCLUDE_FILE_CONCAT ("stdint.h" ${HDF_PREFIX}_HAVE_STDINT_H)
-CHECK_INCLUDE_FILE_CONCAT ("unistd.h" ${HDF_PREFIX}_HAVE_UNISTD_H)
-
-# IF the c compiler found stdint, check the C++ as well. On some systems this
-# file will be found by C but not C++, only do this test IF the C++ compiler
-# has been initialized (e.g. the project also includes some c++)
-if (${HDF_PREFIX}_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED)
- CHECK_INCLUDE_FILE_CXX ("stdint.h" ${HDF_PREFIX}_HAVE_STDINT_H_CXX)
- if (NOT ${HDF_PREFIX}_HAVE_STDINT_H_CXX)
- set (${HDF_PREFIX}_HAVE_STDINT_H "" CACHE INTERNAL "Have includes HAVE_STDINT_H")
- set (USE_INCLUDES ${USE_INCLUDES} "stdint.h")
- endif ()
-endif ()
-
-# Darwin
-CHECK_INCLUDE_FILE_CONCAT ("mach/mach_time.h" ${HDF_PREFIX}_HAVE_MACH_MACH_TIME_H)
-
-# Windows
-CHECK_INCLUDE_FILE_CONCAT ("io.h" ${HDF_PREFIX}_HAVE_IO_H)
-if (NOT CYGWIN)
- CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" ${HDF_PREFIX}_HAVE_WINSOCK2_H)
-endif ()
-CHECK_INCLUDE_FILE_CONCAT ("sys/timeb.h" ${HDF_PREFIX}_HAVE_SYS_TIMEB_H)
-
-if (CMAKE_SYSTEM_NAME MATCHES "OSF")
- CHECK_INCLUDE_FILE_CONCAT ("sys/sysinfo.h" ${HDF_PREFIX}_HAVE_SYS_SYSINFO_H)
- CHECK_INCLUDE_FILE_CONCAT ("sys/proc.h" ${HDF_PREFIX}_HAVE_SYS_PROC_H)
-else ()
- set (${HDF_PREFIX}_HAVE_SYS_SYSINFO_H "" CACHE INTERNAL "" FORCE)
- set (${HDF_PREFIX}_HAVE_SYS_PROC_H "" CACHE INTERNAL "" FORCE)
-endif ()
-
-CHECK_INCLUDE_FILE_CONCAT ("globus/common.h" ${HDF_PREFIX}_HAVE_GLOBUS_COMMON_H)
-CHECK_INCLUDE_FILE_CONCAT ("pdb.h" ${HDF_PREFIX}_HAVE_PDB_H)
-CHECK_INCLUDE_FILE_CONCAT ("pthread.h" ${HDF_PREFIX}_HAVE_PTHREAD_H)
-CHECK_INCLUDE_FILE_CONCAT ("srbclient.h" ${HDF_PREFIX}_HAVE_SRBCLIENT_H)
-CHECK_INCLUDE_FILE_CONCAT ("string.h" ${HDF_PREFIX}_HAVE_STRING_H)
-CHECK_INCLUDE_FILE_CONCAT ("strings.h" ${HDF_PREFIX}_HAVE_STRINGS_H)
-CHECK_INCLUDE_FILE_CONCAT ("stdlib.h" ${HDF_PREFIX}_HAVE_STDLIB_H)
-CHECK_INCLUDE_FILE_CONCAT ("memory.h" ${HDF_PREFIX}_HAVE_MEMORY_H)
-CHECK_INCLUDE_FILE_CONCAT ("dlfcn.h" ${HDF_PREFIX}_HAVE_DLFCN_H)
-CHECK_INCLUDE_FILE_CONCAT ("inttypes.h" ${HDF_PREFIX}_HAVE_INTTYPES_H)
-CHECK_INCLUDE_FILE_CONCAT ("netinet/in.h" ${HDF_PREFIX}_HAVE_NETINET_IN_H)
-
-#-----------------------------------------------------------------------------
# Check for large file support
#-----------------------------------------------------------------------------
@@ -273,7 +262,7 @@ set (LINUX_LFS 0)
set (HDF_EXTRA_C_FLAGS)
set (HDF_EXTRA_FLAGS)
-if (NOT WINDOWS)
+if (MINGW OR NOT WINDOWS)
# Might want to check explicitly for Linux and possibly Cygwin
# instead of checking for not Solaris or Darwin.
if (NOT ${HDF_PREFIX}_HAVE_SOLARIS AND NOT ${HDF_PREFIX}_HAVE_DARWIN)
@@ -286,20 +275,19 @@ if (NOT WINDOWS)
# systems.
# POSIX feature information can be found in the gcc manual at:
# http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html
- set (HDF_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=200112L)
+ set (HDF_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=200809L)
# Need to add this so that O_DIRECT is visible for the direct
# VFD on Linux systems.
- set (HDF_EXTRA_C_FLAGS -D_GNU_SOURCE)
+ set (HDF_EXTRA_C_FLAGS ${HDF_EXTRA_C_FLAGS} -D_GNU_SOURCE)
option (HDF_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON)
- if (HDF_ENABLE_LARGE_FILE)
+ if (HDF_ENABLE_LARGE_FILE AND NOT DEFINED TEST_LFS_WORKS_RUN)
set (msg "Performing TEST_LFS_WORKS")
- TRY_RUN (TEST_LFS_WORKS_RUN TEST_LFS_WORKS_COMPILE
+ try_run (TEST_LFS_WORKS_RUN TEST_LFS_WORKS_COMPILE
${CMAKE_BINARY_DIR}
${HDF_RESOURCES_EXT_DIR}/HDFTests.c
- CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-DTEST_LFS_WORKS
- OUTPUT_VARIABLE OUTPUT
+ COMPILE_DEFINITIONS "-DTEST_LFS_WORKS"
)
# The LARGEFILE definitions were from the transition period
@@ -316,14 +304,14 @@ if (NOT WINDOWS)
set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg})
message (STATUS "${msg}... no")
file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Test TEST_LFS_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n"
+ "Test TEST_LFS_WORKS Run failed with the following exit code:\n ${TEST_LFS_WORKS_RUN}\n"
)
endif ()
else ()
set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg})
message (STATUS "${msg}... no")
file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Test TEST_LFS_WORKS Compile failed with the following output:\n ${OUTPUT}\n"
+ "Test TEST_LFS_WORKS Compile failed\n"
)
endif ()
endif ()
@@ -331,26 +319,19 @@ if (NOT WINDOWS)
endif ()
endif ()
-add_definitions (${HDF_EXTRA_FLAGS})
-
#-----------------------------------------------------------------------------
# Check for HAVE_OFF64_T functionality
#-----------------------------------------------------------------------------
-if (NOT WINDOWS OR MINGW)
+if (MINGW OR NOT WINDOWS)
HDF_FUNCTION_TEST (HAVE_OFF64_T)
if (${HDF_PREFIX}_HAVE_OFF64_T)
CHECK_FUNCTION_EXISTS (lseek64 ${HDF_PREFIX}_HAVE_LSEEK64)
- CHECK_FUNCTION_EXISTS (fseeko64 ${HDF_PREFIX}_HAVE_FSEEKO64)
- CHECK_FUNCTION_EXISTS (ftello64 ${HDF_PREFIX}_HAVE_FTELLO64)
- CHECK_FUNCTION_EXISTS (ftruncate64 ${HDF_PREFIX}_HAVE_FTRUNCATE64)
endif ()
CHECK_FUNCTION_EXISTS (fseeko ${HDF_PREFIX}_HAVE_FSEEKO)
- CHECK_FUNCTION_EXISTS (ftello ${HDF_PREFIX}_HAVE_FTELLO)
- HDF_FUNCTION_TEST (HAVE_STAT64_STRUCT)
+ CHECK_STRUCT_HAS_MEMBER("struct stat64" st_blocks "sys/types.h;sys/stat.h" HAVE_STAT64_STRUCT)
if (HAVE_STAT64_STRUCT)
- CHECK_FUNCTION_EXISTS (fstat64 ${HDF_PREFIX}_HAVE_FSTAT64)
CHECK_FUNCTION_EXISTS (stat64 ${HDF_PREFIX}_HAVE_STAT64)
endif ()
endif ()
@@ -420,7 +401,7 @@ if (NOT APPLE)
if (NOT ${HDF_PREFIX}_SIZEOF_SSIZE_T)
set (${HDF_PREFIX}_SIZEOF_SSIZE_T 0)
endif ()
- if (NOT WINDOWS)
+ if (MINGW OR NOT WINDOWS)
HDF_CHECK_TYPE_SIZE (ptrdiff_t ${HDF_PREFIX}_SIZEOF_PTRDIFF_T)
endif ()
endif ()
@@ -430,13 +411,13 @@ HDF_CHECK_TYPE_SIZE (off64_t ${HDF_PREFIX}_SIZEOF_OFF64_T)
if (NOT ${HDF_PREFIX}_SIZEOF_OFF64_T)
set (${HDF_PREFIX}_SIZEOF_OFF64_T 0)
endif ()
+HDF_CHECK_TYPE_SIZE (time_t ${HDF_PREFIX}_SIZEOF_TIME_T)
#-----------------------------------------------------------------------------
# Extra C99 types
#-----------------------------------------------------------------------------
# _Bool type support
-CHECK_INCLUDE_FILE_CONCAT (stdbool.h ${HDF_PREFIX}_HAVE_STDBOOL_H)
if (HAVE_STDBOOL_H)
set (CMAKE_EXTRA_INCLUDE_FILES stdbool.h)
HDF_CHECK_TYPE_SIZE (bool ${HDF_PREFIX}_SIZEOF_BOOL)
@@ -444,7 +425,7 @@ else ()
HDF_CHECK_TYPE_SIZE (_Bool ${HDF_PREFIX}_SIZEOF_BOOL)
endif ()
-if (NOT WINDOWS)
+if (MINGW OR NOT WINDOWS)
#-----------------------------------------------------------------------------
# Check if the dev_t type is a scalar type
#-----------------------------------------------------------------------------
@@ -459,39 +440,42 @@ if (NOT WINDOWS)
#-----------------------------------------------------------------------------
# Check a bunch of time functions
#-----------------------------------------------------------------------------
+ CHECK_STRUCT_HAS_MEMBER("struct tm" tm_gmtoff "time.h" ${HDF_PREFIX}_HAVE_TM_GMTOFF)
+ CHECK_STRUCT_HAS_MEMBER("struct tm" __tm_gmtoff "time.h" ${HDF_PREFIX}_HAVE___TM_GMTOFF)
+ CHECK_STRUCT_HAS_MEMBER("struct tm" tm_sec "sys/types.h;sys/time.h;time.h" ${HDF_PREFIX}_TIME_WITH_SYS_TIME)
+ if (${HDF_PREFIX}_HAVE_SYS_TIME_H)
+ CHECK_STRUCT_HAS_MEMBER("struct tm" tz_minuteswest "sys/types.h;sys/time.h;time.h" ${HDF_PREFIX}_HAVE_STRUCT_TIMEZONE)
+ else ()
+ CHECK_STRUCT_HAS_MEMBER("struct tm" tz_minuteswest "sys/types.h;time.h" ${HDF_PREFIX}_HAVE_STRUCT_TIMEZONE)
+ endif ()
CHECK_FUNCTION_EXISTS (gettimeofday ${HDF_PREFIX}_HAVE_GETTIMEOFDAY)
- foreach (test
- HAVE_TM_GMTOFF
- HAVE___TM_GMTOFF
+ foreach (time_test
# HAVE_TIMEZONE
- HAVE_STRUCT_TIMEZONE
GETTIMEOFDAY_GIVES_TZ
- TIME_WITH_SYS_TIME
HAVE_TM_ZONE
HAVE_STRUCT_TM_TM_ZONE
)
- HDF_FUNCTION_TEST (${test})
+ HDF_FUNCTION_TEST (${time_test})
endforeach ()
if (NOT CYGWIN AND NOT MINGW)
HDF_FUNCTION_TEST (HAVE_TIMEZONE)
-# HDF_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS)
endif ()
# ----------------------------------------------------------------------
# Does the struct stat have the st_blocks field? This field is not Posix.
#
- HDF_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS)
+ CHECK_STRUCT_HAS_MEMBER("struct stat" st_blocks "sys/types.h;sys/stat.h" ${HDF_PREFIX}_HAVE_STAT_ST_BLOCKS)
# ----------------------------------------------------------------------
# How do we figure out the width of a tty in characters?
#
CHECK_FUNCTION_EXISTS (ioctl ${HDF_PREFIX}_HAVE_IOCTL)
- HDF_FUNCTION_TEST (HAVE_STRUCT_VIDEOCONFIG)
- HDF_FUNCTION_TEST (HAVE_STRUCT_TEXT_INFO)
+ CHECK_STRUCT_HAS_MEMBER ("struct videoconfig" numtextcols "" ${HDF_PREFIX}_HAVE_STRUCT_VIDEOCONFIG)
+ CHECK_STRUCT_HAS_MEMBER ("struct text_info" screenwidth "" ${HDF_PREFIX}_HAVE_STRUCT_TEXT_INFO)
CHECK_FUNCTION_EXISTS (_getvideoconfig ${HDF_PREFIX}_HAVE__GETVIDEOCONFIG)
CHECK_FUNCTION_EXISTS (gettextinfo ${HDF_PREFIX}_HAVE_GETTEXTINFO)
CHECK_FUNCTION_EXISTS (_scrsize ${HDF_PREFIX}_HAVE__SCRSIZE)
- if (NOT CYGWIN AND NOT MINGW)
+ if (NOT CYGWIN)
CHECK_FUNCTION_EXISTS (GetConsoleScreenBufferInfo ${HDF_PREFIX}_HAVE_GETCONSOLESCREENBUFFERINFO)
endif ()
CHECK_SYMBOL_EXISTS (TIOCGWINSZ "sys/ioctl.h" ${HDF_PREFIX}_HAVE_TIOCGWINSZ)
@@ -523,6 +507,8 @@ CHECK_FUNCTION_EXISTS (lround ${HDF_PREFIX}_HAVE_LROUND)
CHECK_FUNCTION_EXISTS (lroundf ${HDF_PREFIX}_HAVE_LROUNDF)
CHECK_FUNCTION_EXISTS (lstat ${HDF_PREFIX}_HAVE_LSTAT)
+CHECK_FUNCTION_EXISTS (pread ${HDF_PREFIX}_HAVE_PREAD)
+CHECK_FUNCTION_EXISTS (pwrite ${HDF_PREFIX}_HAVE_PWRITE)
CHECK_FUNCTION_EXISTS (rand_r ${HDF_PREFIX}_HAVE_RAND_R)
CHECK_FUNCTION_EXISTS (random ${HDF_PREFIX}_HAVE_RANDOM)
CHECK_FUNCTION_EXISTS (round ${HDF_PREFIX}_HAVE_ROUND)
@@ -550,7 +536,7 @@ CHECK_FUNCTION_EXISTS (vasprintf ${HDF_PREFIX}_HAVE_VASPRINTF)
CHECK_FUNCTION_EXISTS (waitpid ${HDF_PREFIX}_HAVE_WAITPID)
CHECK_FUNCTION_EXISTS (vsnprintf ${HDF_PREFIX}_HAVE_VSNPRINTF)
-if (NOT WINDOWS)
+if (MINGW OR NOT WINDOWS)
if (${HDF_PREFIX}_HAVE_VSNPRINTF)
HDF_FUNCTION_TEST (VSNPRINTF_WORKS)
endif ()
@@ -571,8 +557,8 @@ endif ()
#-----------------------------------------------------------------------------
# Check a bunch of other functions
#-----------------------------------------------------------------------------
-if (NOT WINDOWS)
- foreach (test
+if (MINGW OR NOT WINDOWS)
+ foreach (other_test
HAVE_ATTRIBUTE
HAVE_C99_FUNC
# STDC_HEADERS
@@ -581,72 +567,7 @@ if (NOT WINDOWS)
SYSTEM_SCOPE_THREADS
HAVE_SOCKLEN_T
)
- HDF_FUNCTION_TEST (${test})
- endforeach ()
-endif ()
-
-# For other CXX specific tests, use this MACRO.
-macro (HDF_CXX_FUNCTION_TEST OTHER_TEST)
- if (NOT DEFINED ${OTHER_TEST})
- set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}")
- set (OTHER_TEST_ADD_LIBRARIES)
- if (CMAKE_REQUIRED_LIBRARIES)
- set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
- endif ()
-
- foreach (def
- HAVE_SYS_TIME_H
- HAVE_UNISTD_H
- HAVE_SYS_TYPES_H
- HAVE_SYS_SOCKET_H
- HAVE_SYS_FILE_H
- )
- if ("${${HDF_PREFIX}_${def}}")
- set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}")
- endif ()
- endforeach ()
-
- if (LARGEFILE)
- set (MACRO_CHECK_FUNCTION_DEFINITIONS
- "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE"
- )
- endif ()
-
- #message (STATUS "Performing ${OTHER_TEST}")
- TRY_COMPILE (${OTHER_TEST}
- ${CMAKE_BINARY_DIR}
- ${HDF_RESOURCES_EXT_DIR}/HDFCXXTests.cpp
- CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
- "${OTHER_TEST_ADD_LIBRARIES}"
- OUTPUT_VARIABLE OUTPUT
- )
- if (${OTHER_TEST} EQUAL 0)
- set (${OTHER_TEST} 1 CACHE INTERNAL "CXX test ${FUNCTION}")
- message (STATUS "Performing CXX Test ${OTHER_TEST} - Success")
- else ()
- message (STATUS "Performing CXX Test ${OTHER_TEST} - Failed")
- set (${OTHER_TEST} "" CACHE INTERNAL "CXX test ${FUNCTION}")
- file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
- "Performing CXX Test ${OTHER_TEST} failed with the following output:\n"
- "${OUTPUT}\n"
- )
- endif ()
- endif ()
-endmacro ()
-
-#-----------------------------------------------------------------------------
-# Check a bunch of cxx functions
-#-----------------------------------------------------------------------------
-if (CMAKE_CXX_COMPILER_LOADED)
- foreach (test
- OLD_HEADER_FILENAME
- ${HDF_PREFIX}_NO_NAMESPACE
- ${HDF_PREFIX}_NO_STD
- BOOL_NOTDEFINED
- NO_STATIC_CAST
- CXX_HAVE_OFFSETOF
- )
- HDF_CXX_FUNCTION_TEST (${test})
+ HDF_FUNCTION_TEST (${other_test})
endforeach ()
endif ()
@@ -656,36 +577,27 @@ endif ()
if (WINDOWS)
if (NOT HDF_NO_IOEO_TEST)
message (STATUS "Checking for InitOnceExecuteOnce:")
- if (NOT DEFINED ${${HDF_PREFIX}_HAVE_IOEO})
+ if (NOT DEFINED ${HDF_PREFIX}_HAVE_IOEO)
if (LARGEFILE)
set (CMAKE_REQUIRED_DEFINITIONS
"${CURRENT_TEST_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE"
)
endif ()
- set (MACRO_CHECK_FUNCTION_DEFINITIONS
- "-DHAVE_IOEO ${CMAKE_REQUIRED_FLAGS}")
- if (CMAKE_REQUIRED_LIBRARIES)
- set (CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
- "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
- else ()
- set (CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
- endif ()
+ set (MACRO_CHECK_FUNCTION_DEFINITIONS "-DHAVE_IOEO ${CMAKE_REQUIRED_FLAGS}")
if (CMAKE_REQUIRED_INCLUDES)
- set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
- "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
+ set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
else ()
set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
endif ()
TRY_RUN(HAVE_IOEO_EXITCODE HAVE_IOEO_COMPILED
- ${CMAKE_BINARY_DIR}
- ${HDF_RESOURCES_EXT_DIR}/HDFTests.c
- COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
- CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
- -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}
- "${CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}"
- "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
- COMPILE_OUTPUT_VARIABLE OUTPUT)
+ ${CMAKE_BINARY_DIR}
+ ${HDF_RESOURCES_EXT_DIR}/HDFTests.c
+ COMPILE_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} ${MACRO_CHECK_FUNCTION_DEFINITIONS}"
+ LINK_LIBRARIES "${HDF5_REQUIRED_LIBRARIES}"
+ CMAKE_FLAGS "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES} -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}"
+ COMPILE_OUTPUT_VARIABLE OUTPUT
+ )
# if it did not compile make the return value fail code of 1
if (NOT HAVE_IOEO_COMPILED)
set (HAVE_IOEO_EXITCODE 1)
@@ -736,8 +648,8 @@ if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES "
TRY_RUN (${HDF_PREFIX}_PRINTF_LL_TEST_RUN ${HDF_PREFIX}_PRINTF_LL_TEST_COMPILE
${CMAKE_BINARY_DIR}
${HDF_RESOURCES_EXT_DIR}/HDFTests.c
- CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CURRENT_TEST_DEFINITIONS}
- OUTPUT_VARIABLE OUTPUT
+ COMPILE_DEFINITIONS "${CURRENT_TEST_DEFINITIONS}"
+ RUN_OUTPUT_VARIABLE OUTPUT
)
if (${HDF_PREFIX}_PRINTF_LL_TEST_COMPILE)
if (${HDF_PREFIX}_PRINTF_LL_TEST_RUN MATCHES 0)
@@ -745,11 +657,11 @@ if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES "
set (${HDF_PREFIX}_PRINTF_LL_WIDTH "\"${${HDF_PREFIX}_PRINTF_LL}\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll")
set (PRINT_LL_FOUND 1)
else ()
- message ("Width test failed with result: ${${HDF_PREFIX}_PRINTF_LL_TEST_RUN}")
+ message (STATUS "Width test failed with result: ${${HDF_PREFIX}_PRINTF_LL_TEST_RUN}")
endif ()
else ()
file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
- "Test ${HDF_PREFIX}_PRINTF_LL_WIDTH failed with the following output:\n ${OUTPUT}\n"
+ "Test ${HDF_PREFIX}_PRINTF_LL_WIDTH failed\n"
)
endif ()
diff --git a/config/cmake_ext_mod/FindSZIP.cmake b/config/cmake_ext_mod/FindSZIP.cmake
index 699be85..c3dc04a 100644
--- a/config/cmake_ext_mod/FindSZIP.cmake
+++ b/config/cmake_ext_mod/FindSZIP.cmake
@@ -5,140 +5,112 @@
# 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://support.hdfgroup.org/ftp/HDF5/releases.
+# 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 SZIP library
-# - Derived from the FindTiff.cmake that is included with cmake
# Find the native SZIP includes and library
-# This module defines
-# SZIP_INCLUDE_DIRS, where to find tiff.h, etc.
-# SZIP_LIBRARIES, libraries to link against to use SZIP.
-# SZIP_FOUND, If false, do not try to use SZIP.
-# also defined, but not for general use are
-# 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..." )
+# Imported targets
+##################
-############################################
+# This module defines the following :prop_tgt:`IMPORTED` targets:
#
-# Check the existence of the libraries.
+# SZIP::SZIP
+# The SZIP library, if found.
#
-############################################
-# This macro was taken directly from the FindQt4.cmake file that is included
-# with the CMake distribution. This is NOT my work. All work was done by the
-# original authors of the FindQt4.cmake file. Only minor modifications were
-# made to remove references to Qt and make this file more generally applicable
-#########################################################################
+# Result variables
+###################
-macro (SZIP_ADJUST_LIB_VARS basename)
- if (${basename}_INCLUDE_DIR)
+# This module will set the following variables in your project:
- # if only the release version was found, set the debug variable also to the release version
- if (${basename}_LIBRARY_RELEASE AND NOT ${basename}_LIBRARY_DEBUG)
- set (${basename}_LIBRARY_DEBUG ${${basename}_LIBRARY_RELEASE})
- set (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE})
- set (${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE})
- endif ()
+# 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.
- # if only the debug version was found, set the release variable also to the debug version
- if (${basename}_LIBRARY_DEBUG AND NOT ${basename}_LIBRARY_RELEASE)
- set (${basename}_LIBRARY_RELEASE ${${basename}_LIBRARY_DEBUG})
- set (${basename}_LIBRARY ${${basename}_LIBRARY_DEBUG})
- set (${basename}_LIBRARIES ${${basename}_LIBRARY_DEBUG})
- endif ()
- if (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE)
- # if the generator supports configuration types then set
- # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
- if (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
- set (${basename}_LIBRARY optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG})
- else ()
- # if there are no configuration types and CMAKE_BUILD_TYPE has no value
- # then just use the release libraries
- set (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} )
- endif ()
- set (${basename}_LIBRARIES optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG})
- endif ()
+# Cache variables
+#################
- set (${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH "The ${basename} library")
+# The following variables may also be set:
- if (${basename}_LIBRARY)
- set (${basename}_FOUND 1)
- endif ()
- endif ()
+# SZIP_LIBRARY, where to find the SZIP library.
+# SZIP_LIBRARY_DEBUG - Debug version of SZIP library
+# SZIP_LIBRARY_RELEASE - Release Version of SZIP library
- # Make variables changeble to the advanced user
- MARK_AS_ADVANCED (${basename}_LIBRARY ${basename}_LIBRARY_RELEASE ${basename}_LIBRARY_DEBUG ${basename}_INCLUDE_DIR )
-endmacro ()
-
-
-# Look for the header file.
-set (SZIP_INCLUDE_SEARCH_DIRS
- $ENV{SZIP_INSTALL}/include
- $ENV{SZIP_INSTALL}/include/szip
- /usr/include
- /usr/include/szip
-)
-
-set (SZIP_LIB_SEARCH_DIRS
- $ENV{SZIP_INSTALL}/lib
- /usr/lib
-)
-
-set (SZIP_BIN_SEARCH_DIRS
- $ENV{SZIP_INSTALL}/bin
- /usr/bin
-)
-
-FIND_PATH (SZIP_INCLUDE_DIR
- NAMES szlib.h
- PATHS ${SZIP_INCLUDE_SEARCH_DIRS}
- NO_DEFAULT_PATH
-)
-
-if (WIN32)
- set (SZIP_SEARCH_DEBUG_NAMES "sz_d;libsz_d")
- set (SZIP_SEARCH_RELEASE_NAMES "sz;libsz;libszip")
-else ()
- set (SZIP_SEARCH_DEBUG_NAMES "sz_d")
- set (SZIP_SEARCH_RELEASE_NAMES "sz;szip")
-endif ()
+# message (STATUS "Finding SZIP library and headers..." )
+#########################################################################
-# Look for the library.
-FIND_LIBRARY (SZIP_LIBRARY_DEBUG
- NAMES ${SZIP_SEARCH_DEBUG_NAMES}
- PATHS ${SZIP_LIB_SEARCH_DIRS}
- NO_DEFAULT_PATH
-)
-
-FIND_LIBRARY (SZIP_LIBRARY_RELEASE
- NAMES ${SZIP_SEARCH_RELEASE_NAMES}
- PATHS ${SZIP_LIB_SEARCH_DIRS}
- NO_DEFAULT_PATH
-)
-
-SZIP_ADJUST_LIB_VARS (SZIP)
-
-if (SZIP_INCLUDE_DIR AND SZIP_LIBRARY)
- set (SZIP_FOUND 1)
- set (SZIP_LIBRARIES ${SZIP_LIBRARY})
- set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR})
- if (SZIP_LIBRARY_DEBUG)
- get_filename_component (SZIP_LIBRARY_PATH ${SZIP_LIBRARY_DEBUG} PATH)
- set (SZIP_LIB_DIR ${SZIP_LIBRARY_PATH})
- elseif ()
- get_filename_component (SZIP_LIBRARY_PATH ${SZIP_LIBRARY_RELEASE} PATH)
- set (SZIP_LIB_DIR ${SZIP_LIBRARY_PATH})
- endif ()
-else ()
- set (SZIP_FOUND 0)
- set (SZIP_LIBRARIES)
- set (SZIP_INCLUDE_DIRS)
-endif ()
+
+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)
@@ -153,29 +125,3 @@ if (NOT SZIP_FOUND)
endif ()
endif ()
endif ()
-
-if (SZIP_FOUND)
- include (CheckSymbolExists)
- #############################################
- # Find out if SZIP was build using dll's
- #############################################
- # Save required variable
- set (CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
- set (CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS})
- # Add SZIP_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES
- set (CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${SZIP_INCLUDE_DIRS}")
-
- # Restore CMAKE_REQUIRED_INCLUDES and CMAKE_REQUIRED_FLAGS variables
- set (CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE})
- set (CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE})
- #
- #############################################
-endif ()
-
-if (FIND_SZIP_DEBUG)
- message (STATUS "SZIP_INCLUDE_DIR: ${SZIP_INCLUDE_DIR}")
- message (STATUS "SZIP_INCLUDE_DIRS: ${SZIP_INCLUDE_DIRS}")
- message (STATUS "SZIP_LIBRARY_DEBUG: ${SZIP_LIBRARY_DEBUG}")
- message (STATUS "SZIP_LIBRARY_RELEASE: ${SZIP_LIBRARY_RELEASE}")
- message (STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
-endif ()
diff --git a/config/cmake_ext_mod/GetTimeOfDayTest.cpp b/config/cmake_ext_mod/GetTimeOfDayTest.cpp
index 5fd7c04..b35efa5 100644
--- a/config/cmake_ext_mod/GetTimeOfDayTest.cpp
+++ b/config/cmake_ext_mod/GetTimeOfDayTest.cpp
@@ -5,7 +5,7 @@
* 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://support.hdfgroup.org/ftp/HDF5/releases. *
+ * 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. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
diff --git a/config/cmake_ext_mod/HDFCXXTests.cpp b/config/cmake_ext_mod/HDFCXXTests.cpp
index 1b98092..f05151b 100644
--- a/config/cmake_ext_mod/HDFCXXTests.cpp
+++ b/config/cmake_ext_mod/HDFCXXTests.cpp
@@ -5,7 +5,7 @@
* 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://support.hdfgroup.org/ftp/HDF5/releases. *
+ * 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. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
diff --git a/config/cmake_ext_mod/HDFLibMacros.cmake b/config/cmake_ext_mod/HDFLibMacros.cmake
index 54e408b..821ac2d 100644
--- a/config/cmake_ext_mod/HDFLibMacros.cmake
+++ b/config/cmake_ext_mod/HDFLibMacros.cmake
@@ -5,7 +5,7 @@
# 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://support.hdfgroup.org/ftp/HDF5/releases.
+# 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.
#
@@ -14,30 +14,13 @@ 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}
- )
- elseif (${compress_type} MATCHES "GIT")
+ if (${compress_type} MATCHES "GIT")
EXTERNALPROJECT_ADD (JPEG
GIT_REPOSITORY ${JPEG_URL}
GIT_TAG ${JPEG_BRANCH}
INSTALL_COMMAND ""
CMAKE_ARGS
- -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
+ -DBUILD_SHARED_LIBS:BOOL=OFF
-DJPEG_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT}
-DJPEG_EXTERNALLY_CONFIGURED:BOOL=OFF
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
@@ -47,6 +30,8 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic)
-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}
+ -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE}
)
elseif (${compress_type} MATCHES "TGZ")
EXTERNALPROJECT_ADD (JPEG
@@ -54,7 +39,7 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic)
URL_MD5 ""
INSTALL_COMMAND ""
CMAKE_ARGS
- -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
+ -DBUILD_SHARED_LIBS:BOOL=OFF
-DJPEG_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT}
-DJPEG_EXTERNALLY_CONFIGURED:BOOL=OFF
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
@@ -64,25 +49,19 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic)
-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}
+ -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 jpeg-static)
- 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 jpeg-shared)
- set (JPEG_SHARED_LIBRARY "jpeg-shared")
- set (JPEG_LIBRARIES ${JPEG_LIBRARIES} ${JPEG_SHARED_LIBRARY})
- endif ()
set (JPEG_INCLUDE_DIR_GEN "${BINARY_DIR}")
set (JPEG_INCLUDE_DIR "${SOURCE_DIR}/src")
@@ -97,38 +76,20 @@ 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}
- )
- elseif (${compress_type} MATCHES "GIT")
+ if (${compress_type} MATCHES "GIT")
EXTERNALPROJECT_ADD (SZIP
GIT_REPOSITORY ${SZIP_URL}
GIT_TAG ${SZIP_BRANCH}
INSTALL_COMMAND ""
CMAKE_ARGS
- -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
+ -DBUILD_SHARED_LIBS:BOOL=OFF
-DSZIP_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT}
-DSZIP_EXTERNALLY_CONFIGURED:BOOL=OFF
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
@@ -139,6 +100,8 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding)
-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}
+ -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE}
)
elseif (${compress_type} MATCHES "TGZ")
EXTERNALPROJECT_ADD (SZIP
@@ -146,7 +109,7 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding)
URL_MD5 ""
INSTALL_COMMAND ""
CMAKE_ARGS
- -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
+ -DBUILD_SHARED_LIBS:BOOL=OFF
-DSZIP_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT}
-DSZIP_EXTERNALLY_CONFIGURED:BOOL=OFF
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
@@ -157,25 +120,29 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding)
-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}
+ -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)
+##include (${BINARY_DIR}/${SZ_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 szip-static)
- set (SZIP_STATIC_LIBRARY "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 szip-shared)
- set (SZIP_SHARED_LIBRARY "szip-shared")
- set (SZIP_LIBRARIES ${SZIP_LIBRARIES} ${SZIP_SHARED_LIBRARY})
+ if (USE_LIBAEC)
+ add_library(${HDF_PACKAGE_NAMESPACE}sz-static STATIC IMPORTED)
+ HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}sz-static "sz" STATIC "")
+ add_dependencies (${HDF_PACKAGE_NAMESPACE}sz-static SZIP)
+ add_library(${HDF_PACKAGE_NAMESPACE}aec-static STATIC IMPORTED)
+ HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}aec-static "aec" STATIC "")
+ add_dependencies (${HDF_PACKAGE_NAMESPACE}aec-static SZIP)
+ set (SZIP_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}sz-static;${HDF_PACKAGE_NAMESPACE}aec-static")
+ else ()
+ 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")
endif ()
+ set (SZIP_LIBRARIES ${SZIP_STATIC_LIBRARY})
set (SZIP_INCLUDE_DIR_GEN "${BINARY_DIR}")
set (SZIP_INCLUDE_DIR "${SOURCE_DIR}/src")
@@ -185,42 +152,29 @@ endmacro ()
#-------------------------------------------------------------------------------
macro (PACKAGE_SZIP_LIBRARY compress_type)
+ set (SZIP_HDR "SZconfig")
+ if (USE_LIBAEC)
+ set (SZIP_HDR "libaec_Export")
+ endif ()
add_custom_target (SZIP-GenHeader-Copy ALL
- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SZIP_INCLUDE_DIR_GEN}/SZconfig.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/
- COMMENT "Copying ${SZIP_INCLUDE_DIR_GEN}/SZconfig.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/"
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SZIP_INCLUDE_DIR_GEN}/${SZIP_HDR}.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/
+ COMMENT "Copying ${SZIP_INCLUDE_DIR_GEN}/${SZIP_HDR}.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")
+ set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${SZIP_HDR}.h)
+ 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}
- )
- elseif (${compress_type} MATCHES "GIT")
+ if (${compress_type} MATCHES "GIT")
EXTERNALPROJECT_ADD (ZLIB
GIT_REPOSITORY ${ZLIB_URL}
GIT_TAG ${ZLIB_BRANCH}
INSTALL_COMMAND ""
CMAKE_ARGS
- -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
+ -DBUILD_SHARED_LIBS:BOOL=OFF
-DZLIB_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT}
-DZLIB_EXTERNALLY_CONFIGURED:BOOL=OFF
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
@@ -230,6 +184,8 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type)
-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}
+ -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE}
)
elseif (${compress_type} MATCHES "TGZ")
EXTERNALPROJECT_ADD (ZLIB
@@ -237,7 +193,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type)
URL_MD5 ""
INSTALL_COMMAND ""
CMAKE_ARGS
- -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
+ -DBUILD_SHARED_LIBS:BOOL=OFF
-DZLIB_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT}
-DZLIB_EXTERNALLY_CONFIGURED:BOOL=OFF
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
@@ -247,6 +203,8 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type)
-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}
+ -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE}
)
endif ()
externalproject_get_property (ZLIB BINARY_DIR SOURCE_DIR)
@@ -258,19 +216,12 @@ 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 zlib-static)
- 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 zlib-shared)
- set (ZLIB_SHARED_LIBRARY "zlib-shared")
- set (ZLIB_LIBRARIES ${ZLIB_LIBRARIES} ${ZLIB_SHARED_LIBRARY})
- endif ()
set (ZLIB_INCLUDE_DIR_GEN "${BINARY_DIR}")
set (ZLIB_INCLUDE_DIR "${SOURCE_DIR}")
@@ -285,7 +236,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 ()
diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake
index 04d60e1..c26956b 100644
--- a/config/cmake_ext_mod/HDFMacros.cmake
+++ b/config/cmake_ext_mod/HDFMacros.cmake
@@ -5,7 +5,7 @@
# 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://support.hdfgroup.org/ftp/HDF5/releases.
+# 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.
#
@@ -14,7 +14,7 @@
macro (SET_HDF_BUILD_TYPE)
get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(_isMultiConfig)
- set(HDF_CFG_NAME ${CTEST_CONFIGURATION_TYPE})
+ set(HDF_CFG_NAME ${CMAKE_BUILD_TYPE})
set(HDF_BUILD_TYPE ${CMAKE_CFG_INTDIR})
set(HDF_CFG_BUILD_TYPE \${CMAKE_INSTALL_CONFIG_NAME})
else()
@@ -28,7 +28,7 @@ macro (SET_HDF_BUILD_TYPE)
endif()
endif()
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
- message(STATUS "Setting build type to 'RelWithDebInfo' as none was specified.")
+ message (STATUS "Setting build type to 'RelWithDebInfo' as none was specified.")
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
@@ -73,22 +73,21 @@ endmacro ()
#-------------------------------------------------------------------------------
macro (INSTALL_TARGET_PDB libtarget targetdestination targetcomponent)
- if (WIN32 AND MSVC)
+ if (WIN32 AND MSVC AND NOT DISABLE_PDB_FILES)
get_target_property (target_type ${libtarget} TYPE)
if (${libtype} MATCHES "SHARED")
set (targetfilename $<TARGET_PDB_FILE:${libtarget}>)
else ()
- get_property (target_name TARGET ${libtarget} PROPERTY OUTPUT_NAME_RELWITHDEBINFO)
+ get_property (target_name TARGET ${libtarget} PROPERTY $<IF:$<CONFIG:Debug>,OUTPUT_NAME_DEBUG,OUTPUT_NAME_RELWITHDEBINFO>)
set (targetfilename $<TARGET_FILE_DIR:${libtarget}>/${target_name}.pdb)
endif ()
install (
- FILES
- ${targetfilename}
- DESTINATION
- ${targetdestination}
- CONFIGURATIONS RelWithDebInfo
+ FILES ${targetfilename}
+ DESTINATION ${targetdestination}
+ CONFIGURATIONS Debug RelWithDebInfo
COMPONENT ${targetcomponent}
- )
+ OPTIONAL
+ )
endif ()
endmacro ()
@@ -96,53 +95,45 @@ endmacro ()
macro (INSTALL_PROGRAM_PDB progtarget targetdestination targetcomponent)
if (WIN32 AND MSVC)
install (
- FILES
- $<TARGET_PDB_FILE:${progtarget}>
- DESTINATION
- ${targetdestination}
- CONFIGURATIONS RelWithDebInfo
+ FILES $<TARGET_PDB_FILE:${progtarget}>
+ DESTINATION ${targetdestination}
+ CONFIGURATIONS Debug RelWithDebInfo
COMPONENT ${targetcomponent}
- )
+ OPTIONAL
+ )
endif ()
endmacro ()
#-------------------------------------------------------------------------------
macro (HDF_SET_LIB_OPTIONS libtarget libname libtype)
- if (WIN32)
- set (LIB_DEBUG_SUFFIX "_D")
- else ()
- set (LIB_DEBUG_SUFFIX "_debug")
- endif ()
if (${libtype} MATCHES "SHARED")
set (LIB_RELEASE_NAME "${libname}")
- set (LIB_DEBUG_NAME "${libname}${LIB_DEBUG_SUFFIX}")
+ set (LIB_DEBUG_NAME "${libname}${CMAKE_DEBUG_POSTFIX}")
else ()
- if (WIN32)
+ if (WIN32 AND NOT MINGW)
set (LIB_RELEASE_NAME "lib${libname}")
- set (LIB_DEBUG_NAME "lib${libname}${LIB_DEBUG_SUFFIX}")
+ set (LIB_DEBUG_NAME "lib${libname}${CMAKE_DEBUG_POSTFIX}")
else ()
set (LIB_RELEASE_NAME "${libname}")
- set (LIB_DEBUG_NAME "${libname}${LIB_DEBUG_SUFFIX}")
+ set (LIB_DEBUG_NAME "${libname}${CMAKE_DEBUG_POSTFIX}")
endif ()
endif ()
- set_target_properties (${libtarget}
- PROPERTIES
- OUTPUT_NAME
- ${LIB_RELEASE_NAME}
- OUTPUT_NAME_DEBUG
- ${LIB_DEBUG_NAME}
- OUTPUT_NAME_RELEASE
- ${LIB_RELEASE_NAME}
- OUTPUT_NAME_MINSIZEREL
- ${LIB_RELEASE_NAME}
- OUTPUT_NAME_RELWITHDEBINFO
- ${LIB_RELEASE_NAME}
+ set_target_properties (${libtarget} PROPERTIES
+ OUTPUT_NAME ${LIB_RELEASE_NAME}
+# OUTPUT_NAME_DEBUG ${LIB_DEBUG_NAME}
+ OUTPUT_NAME_RELEASE ${LIB_RELEASE_NAME}
+ OUTPUT_NAME_MINSIZEREL ${LIB_RELEASE_NAME}
+ OUTPUT_NAME_RELWITHDEBINFO ${LIB_RELEASE_NAME}
)
+ #get_property (target_name TARGET ${libtarget} PROPERTY OUTPUT_NAME)
+ #get_property (target_name_debug TARGET ${libtarget} PROPERTY OUTPUT_NAME_DEBUG)
+ #get_property (target_name_rwdi TARGET ${libtarget} PROPERTY OUTPUT_NAME_RELWITHDEBINFO)
+ #message (STATUS "${target_name} : ${target_name_debug} : ${target_name_rwdi}")
+
if (${libtype} MATCHES "STATIC")
if (WIN32)
- set_target_properties (${libtarget}
- PROPERTIES
+ set_target_properties (${libtarget} PROPERTIES
COMPILE_PDB_NAME_DEBUG ${LIB_DEBUG_NAME}
COMPILE_PDB_NAME_RELEASE ${LIB_RELEASE_NAME}
COMPILE_PDB_NAME_MINSIZEREL ${LIB_RELEASE_NAME}
@@ -152,10 +143,9 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype)
endif ()
endif ()
- #----- Use MSVC Naming conventions for Shared Libraries
- if (MINGW AND ${libtype} MATCHES "SHARED")
- set_target_properties (${libtarget}
- PROPERTIES
+ option (HDF5_MSVC_NAMING_CONVENTION "Use MSVC Naming conventions for Shared Libraries" OFF)
+ if (HDF5_MSVC_NAMING_CONVENTION AND MINGW AND ${libtype} MATCHES "SHARED")
+ set_target_properties (${libtarget} PROPERTIES
IMPORT_SUFFIX ".lib"
IMPORT_PREFIX ""
PREFIX ""
@@ -170,7 +160,7 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion)
if (${importtype} MATCHES "IMPORT")
set (importprefix "${CMAKE_STATIC_LIBRARY_PREFIX}")
endif ()
- if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
+ if (${HDF_CFG_NAME} MATCHES "Debug")
set (IMPORT_LIB_NAME ${LIB_DEBUG_NAME})
else ()
set (IMPORT_LIB_NAME ${LIB_RELEASE_NAME})
@@ -190,7 +180,12 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion)
)
endif ()
else ()
- if (CYGWIN)
+ if (MINGW)
+ set_target_properties (${libtarget} PROPERTIES
+ IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${IMPORT_LIB_NAME}.lib"
+ IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}"
+ )
+ elseif (CYGWIN)
set_target_properties (${libtarget} PROPERTIES
IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}"
IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}"
@@ -219,37 +214,14 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion)
endmacro ()
#-------------------------------------------------------------------------------
-macro (TARGET_C_PROPERTIES wintarget libtype addcompileflags addlinkflags)
- if (MSVC)
- TARGET_MSVC_PROPERTIES (${wintarget} ${libtype} "${addcompileflags} ${WIN_COMPILE_FLAGS}" "${addlinkflags} ${WIN_LINK_FLAGS}")
- else ()
- set_target_properties (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}")
- endif ()
-endmacro ()
-
-#-------------------------------------------------------------------------------
-macro (TARGET_MSVC_PROPERTIES wintarget libtype addcompileflags addlinkflags)
- if (MSVC)
- set_target_properties (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}")
- endif ()
-endmacro ()
-
-#-------------------------------------------------------------------------------
-macro (TARGET_FORTRAN_PROPERTIES forttarget libtype addcompileflags addlinkflags)
- if (WIN32)
- TARGET_FORTRAN_WIN_PROPERTIES (${forttarget} ${libtype} "${addcompileflags} ${WIN_COMPILE_FLAGS}" "${addlinkflags} ${WIN_LINK_FLAGS}")
- endif ()
-endmacro ()
-
-#-------------------------------------------------------------------------------
-macro (TARGET_FORTRAN_WIN_PROPERTIES forttarget libtype addcompileflags addlinkflags)
- if (MSVC)
- if (${libtype} MATCHES "SHARED")
- set_target_properties (${forttarget} PROPERTIES COMPILE_FLAGS "/dll ${addcompileflags}" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}")
- else ()
- set_target_properties (${forttarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}")
- endif ()
- endif ()
+macro (TARGET_C_PROPERTIES wintarget libtype)
+ target_compile_options(${wintarget} PRIVATE
+ $<$<C_COMPILER_ID:MSVC>:${WIN_COMPILE_FLAGS}>
+ $<$<CXX_COMPILER_ID:MSVC>:${WIN_COMPILE_FLAGS}>
+ )
+ if(MSVC)
+ set_property(TARGET ${wintarget} APPEND PROPERTY LINK_FLAGS "${WIN_LINK_FLAGS}")
+ endif()
endmacro ()
#-----------------------------------------------------------------------------
@@ -277,6 +249,10 @@ macro (HDF_README_PROPERTIES target_fortran)
set (BINARY_PLATFORM "${BINARY_PLATFORM} Intel")
if (${CMAKE_C_COMPILER_VERSION} MATCHES "^17.*")
set (BINARY_PLATFORM "${BINARY_PLATFORM}, using Intel 17")
+ elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^18.*")
+ set (BINARY_PLATFORM "${BINARY_PLATFORM}, using Intel 18")
+ elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^19.*")
+ set (BINARY_PLATFORM "${BINARY_PLATFORM}, using Intel 19")
else ()
set (BINARY_PLATFORM "${BINARY_PLATFORM}, using Intel ${CMAKE_C_COMPILER_VERSION}")
endif ()
@@ -293,16 +269,18 @@ macro (HDF_README_PROPERTIES target_fortran)
elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^19.*")
if (${CMAKE_C_COMPILER_VERSION} MATCHES "^19.0.*")
set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2015")
- else ()
+ elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^19.16.*")
set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2017")
- endif ()
+ else () #19.23
+ set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2019")
+ endif ()
else ()
set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO ${CMAKE_C_COMPILER_VERSION}")
endif ()
endif ()
elseif (APPLE)
set (BINARY_EXAMPLE_ENDING "tar.gz")
- set (BINARY_INSTALL_ENDING "dmg")
+ set (BINARY_INSTALL_ENDING "sh") # if packaging changes - use dmg
set (BINARY_PLATFORM "${BINARY_PLATFORM} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR}")
set (BINARY_PLATFORM "${BINARY_PLATFORM}, using ${CMAKE_C_COMPILER_ID} C ${CMAKE_C_COMPILER_VERSION}")
else ()
@@ -316,7 +294,9 @@ macro (HDF_README_PROPERTIES target_fortran)
set (BINARY_PLATFORM "${BINARY_PLATFORM} / ${CMAKE_Fortran_COMPILER_ID} Fortran")
endif ()
- if (BUILD_SHARED_LIBS)
+ if (ONLY_SHARED_LIBS)
+ set (LIB_TYPE "Shared")
+ elseif (BUILD_SHARED_LIBS)
set (LIB_TYPE "Static and Shared")
else ()
set (LIB_TYPE "Static")
@@ -363,7 +343,7 @@ macro (HDF_DIR_PATHS package_prefix)
set (${package_prefix}_INSTALL_INCLUDE_DIR include)
endif ()
if (NOT ${package_prefix}_INSTALL_DATA_DIR)
- if (NOT WIN32)
+ if (NOT MSVC)
if (APPLE)
if (${package_prefix}_BUILD_FRAMEWORKS)
set (${package_prefix}_INSTALL_EXTRA_DIR ../SharedSupport)
@@ -373,17 +353,47 @@ macro (HDF_DIR_PATHS package_prefix)
set (${package_prefix}_INSTALL_FWRK_DIR ${CMAKE_INSTALL_FRAMEWORK_PREFIX})
endif ()
set (${package_prefix}_INSTALL_DATA_DIR share)
- set (${package_prefix}_INSTALL_CMAKE_DIR share/cmake)
else ()
set (${package_prefix}_INSTALL_DATA_DIR ".")
- set (${package_prefix}_INSTALL_CMAKE_DIR cmake)
endif ()
endif ()
+ if (NOT ${package_prefix}_INSTALL_CMAKE_DIR)
+ set (${package_prefix}_INSTALL_CMAKE_DIR share/cmake)
+ endif ()
+
+ # Always use full RPATH, i.e. don't skip the full RPATH for the build tree
+ set (CMAKE_SKIP_BUILD_RPATH FALSE)
+ # when building, don't use the install RPATH already
+ # (but later on when installing)
+ set (CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
+ # add the automatically determined parts of the RPATH
+ # which point to directories outside the build tree to the install RPATH
+ set (CMAKE_BUILD_WITH_INSTALL_RPATH ON)
+ if (APPLE)
+ set (CMAKE_INSTALL_NAME_DIR "@rpath")
+ set (CMAKE_INSTALL_RPATH
+ "@executable_path/../${${package_prefix}_INSTALL_LIB_DIR}"
+ "@executable_path/"
+ "@loader_path/../${${package_prefix}_INSTALL_LIB_DIR}"
+ "@loader_path/"
+ )
+ else ()
+ set (CMAKE_INSTALL_RPATH "\$ORIGIN/../${${package_prefix}_INSTALL_LIB_DIR}:\$ORIGIN/")
+ endif ()
if (DEFINED ADDITIONAL_CMAKE_PREFIX_PATH AND EXISTS "${ADDITIONAL_CMAKE_PREFIX_PATH}")
set (CMAKE_PREFIX_PATH ${ADDITIONAL_CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH})
endif ()
+ #set the default debug suffix for all library targets
+ if(NOT CMAKE_DEBUG_POSTFIX)
+ if (WIN32)
+ set (CMAKE_DEBUG_POSTFIX "_D")
+ else ()
+ set (CMAKE_DEBUG_POSTFIX "_debug")
+ endif ()
+ endif ()
+
SET_HDF_BUILD_TYPE()
#-----------------------------------------------------------------------------
@@ -402,13 +412,14 @@ macro (HDF_DIR_PATHS package_prefix)
set (CMAKE_Fortran_MODULE_DIRECTORY
${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all fortran modules."
)
- if (WIN32)
- set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CTEST_CONFIGURATION_TYPE})
+ get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+ if(_isMultiConfig)
+ set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE})
set (CMAKE_PDB_OUTPUT_DIRECTORY
${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all pdb files."
)
else ()
- set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CTEST_CONFIGURATION_TYPE})
+ set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
endif ()
else ()
# if we are externally configured, but the project uses old cmake scripts
@@ -417,5 +428,49 @@ macro (HDF_DIR_PATHS package_prefix)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH})
endif ()
endif ()
+
+ if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+ if (CMAKE_HOST_UNIX)
+ set (CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}"
+ CACHE PATH "Install path prefix, prepended onto install directories." FORCE)
+ else ()
+ GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES)
+ set (CMAKE_INSTALL_PREFIX
+ "${CMAKE_GENERIC_PROGRAM_FILES}/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}"
+ CACHE PATH "Install path prefix, prepended onto install directories." FORCE)
+ set (CMAKE_GENERIC_PROGRAM_FILES)
+ endif ()
+ endif ()
+
+#-----------------------------------------------------------------------------
+# Setup pre-3.14 FetchContent
+#-----------------------------------------------------------------------------
+ if(${CMAKE_VERSION} VERSION_LESS 3.14)
+ macro(FetchContent_MakeAvailable NAME)
+ FetchContent_GetProperties(${NAME})
+ if(NOT ${NAME}_POPULATED)
+ FetchContent_Populate(${NAME})
+ add_subdirectory(${${NAME}_SOURCE_DIR} ${${NAME}_BINARY_DIR})
+ endif()
+ endmacro()
+ endif()
+endmacro ()
+
+macro (ADD_H5_FLAGS h5_flag_var infile)
+ file (STRINGS ${infile} TEST_FLAG_STREAM)
+ #message (STATUS "TEST_FLAG_STREAM=${TEST_FLAG_STREAM}")
+ list (LENGTH TEST_FLAG_STREAM len_flag)
+ if (len_flag GREATER 0)
+ math (EXPR _FP_LEN "${len_flag} - 1")
+ foreach (line RANGE 0 ${_FP_LEN})
+ list (GET TEST_FLAG_STREAM ${line} str_flag)
+ string (REGEX REPLACE "^#.*" "" str_flag "${str_flag}")
+ #message (STATUS "str_flag=${str_flag}")
+ if (str_flag)
+ list (APPEND ${h5_flag_var} "${str_flag}")
+ endif ()
+ endforeach ()
+ endif ()
+ #message (STATUS "h5_flag_var=${${h5_flag_var}}")
endmacro ()
diff --git a/config/cmake_ext_mod/HDFTests.c b/config/cmake_ext_mod/HDFTests.c
index 320fd5b..2d7e1b4 100644
--- a/config/cmake_ext_mod/HDFTests.c
+++ b/config/cmake_ext_mod/HDFTests.c
@@ -5,7 +5,7 @@
* 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://support.hdfgroup.org/ftp/HDF5/releases. *
+ * 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. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -88,25 +88,6 @@ int main(void)
}
#endif
-
-#ifdef TIME_WITH_SYS_TIME
-/* Time with sys/time test */
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
-
-int
-main ()
-{
-if ((struct tm *) 0)
-return 0;
- ;
- return 0;
-}
-
-#endif
-
#ifdef STDC_HEADERS
#include <stdlib.h>
#include <stdarg.h>
@@ -162,26 +143,6 @@ main ()
#endif /* HAVE_FUNCTION */
-#ifdef HAVE_TM_GMTOFF
-
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#include <time.h>
-SIMPLE_TEST(struct tm tm; tm.tm_gmtoff=0);
-
-#endif /* HAVE_TM_GMTOFF */
-
-#ifdef HAVE___TM_GMTOFF
-
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#include <time.h>
-SIMPLE_TEST(struct tm tm; tm.__tm_gmtoff=0);
-
-#endif /* HAVE_TM_GMTOFF */
-
#ifdef HAVE_TIMEZONE
#ifdef HAVE_SYS_TIME_H
@@ -192,24 +153,6 @@ SIMPLE_TEST(timezone=0);
#endif /* HAVE_TIMEZONE */
-#ifdef HAVE_STRUCT_TIMEZONE
-
-#include <sys/types.h>
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#include <time.h>
-SIMPLE_TEST(struct timezone tz; tz.tz_minuteswest=0);
-
-#endif /* HAVE_STRUCT_TIMEZONE */
-
-#ifdef HAVE_STAT_ST_BLOCKS
-
-#include <sys/stat.h>
-SIMPLE_TEST(struct stat sb; sb.st_blocks=0);
-
-#endif /* HAVE_STAT_ST_BLOCKS */
-
#ifdef PRINTF_LL_WIDTH
#ifdef HAVE_LONG_LONG
@@ -235,7 +178,7 @@ int DebugReport(int reportType, char* message, int* returnValue)
int main(void)
{
- char *llwidthArgs[] = { "I64", "l64", "l", "L", "q", "ll", NULL };
+ char *llwidthArgs[] = { "I64", "l64", "ll", "l", "L", "q", NULL };
char *s = malloc(128);
char **currentArg = NULL;
LL_TYPE x = (LL_TYPE)1048576 * (LL_TYPE)1048576;
@@ -319,16 +262,6 @@ int main()
}
#endif
-#ifdef HAVE_STAT64_STRUCT
-#include <sys/types.h>
-#include <sys/stat.h>],
-struct stat64 sb;
-int main()
-{
- return 0;
-}
-#endif
-
#ifdef TEST_DIRECT_VFD_WORKS
#include <sys/types.h>
#include <sys/stat.h>
@@ -432,18 +365,6 @@ int main ()
#endif /* HAVE_IOEO */
-#ifdef HAVE_STRUCT_VIDEOCONFIG
-
-SIMPLE_TEST(struct videoconfig w; w.numtextcols=0);
-
-#endif /* HAVE_TM_GMTOFF */
-
-#ifdef HAVE_STRUCT_TEXT_INFO
-
-SIMPLE_TEST(struct text_info w; w.screenwidth=0);
-
-#endif /* HAVE_TM_GMTOFF */
-
#if defined( HAVE_INLINE ) || defined( HAVE___INLINE__ ) || defined( HAVE___INLINE )
#ifndef __cplusplus
#if defined( HAVE_INLINE )
diff --git a/config/cmake_ext_mod/HDFUseCXX.cmake b/config/cmake_ext_mod/HDFUseCXX.cmake
new file mode 100644
index 0000000..9b4b138
--- /dev/null
+++ b/config/cmake_ext_mod/HDFUseCXX.cmake
@@ -0,0 +1,109 @@
+#
+# 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.
+#
+#
+# This file provides functions for C++ support.
+#
+#-------------------------------------------------------------------------------
+ENABLE_LANGUAGE (CXX)
+set (HDF_PREFIX "H5")
+
+#-------------------------------------------------------------------------------
+# Fix CXX flags if we are compiling staticly on Windows using
+# Windows_MT.cmake from config/cmake/UserMacros
+#-------------------------------------------------------------------------------
+if (BUILD_STATIC_CRT_LIBS)
+ TARGET_STATIC_CRT_FLAGS ()
+endif ()
+
+#-----------------------------------------------------------------------------
+# Configure Checks which require CXX compilation must go in here
+# not in the main ConfigureChecks.cmake files, because if the user has
+# no CXX compiler, problems arise.
+#-----------------------------------------------------------------------------
+include (CheckIncludeFileCXX)
+include (TestForSTDNamespace)
+
+# IF the c compiler found stdint, check the C++ as well. On some systems this
+# file will be found by C but not C++, only do this test IF the C++ compiler
+# has been initialized (e.g. the project also includes some c++)
+if (${HDF_PREFIX}_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED)
+ CHECK_INCLUDE_FILE_CXX ("stdint.h" ${HDF_PREFIX}_HAVE_STDINT_H_CXX)
+ if (NOT ${HDF_PREFIX}_HAVE_STDINT_H_CXX)
+ set (${HDF_PREFIX}_HAVE_STDINT_H "" CACHE INTERNAL "Have includes HAVE_STDINT_H")
+ set (USE_INCLUDES ${USE_INCLUDES} "stdint.h")
+ endif ()
+endif ()
+
+# For other CXX specific tests, use this MACRO.
+macro (HDF_CXX_FUNCTION_TEST OTHER_TEST)
+ if (NOT DEFINED ${OTHER_TEST})
+ set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}")
+ set (OTHER_TEST_ADD_LIBRARIES)
+ if (HDF5_REQUIRED_LIBRARIES)
+ set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${HDF5_REQUIRED_LIBRARIES}")
+ endif ()
+
+ foreach (def
+ HAVE_SYS_TIME_H
+ HAVE_UNISTD_H
+ HAVE_SYS_TYPES_H
+ HAVE_SYS_SOCKET_H
+ HAVE_SYS_FILE_H
+ )
+ if ("${${HDF_PREFIX}_${def}}")
+ set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}")
+ endif ()
+ endforeach ()
+
+ if (LARGEFILE)
+ set (MACRO_CHECK_FUNCTION_DEFINITIONS
+ "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE"
+ )
+ endif ()
+
+ #message (STATUS "Performing ${OTHER_TEST}")
+ TRY_COMPILE (${OTHER_TEST}
+ ${CMAKE_BINARY_DIR}
+ ${HDF_RESOURCES_EXT_DIR}/HDFCXXTests.cpp
+ CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
+ "${OTHER_TEST_ADD_LIBRARIES}"
+ OUTPUT_VARIABLE OUTPUT
+ )
+ if (${OTHER_TEST} EQUAL 0)
+ set (${OTHER_TEST} 1 CACHE INTERNAL "CXX test ${FUNCTION}")
+ message (STATUS "Performing CXX Test ${OTHER_TEST} - Success")
+ else ()
+ message (STATUS "Performing CXX Test ${OTHER_TEST} - Failed")
+ set (${OTHER_TEST} "" CACHE INTERNAL "CXX test ${FUNCTION}")
+ file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
+ "Performing CXX Test ${OTHER_TEST} failed with the following output:\n"
+ "${OUTPUT}\n"
+ )
+ endif ()
+ endif ()
+endmacro ()
+
+#-----------------------------------------------------------------------------
+# Check a bunch of cxx functions
+#-----------------------------------------------------------------------------
+if (CMAKE_CXX_COMPILER_LOADED)
+ foreach (cxx_test
+ OLD_HEADER_FILENAME
+ HDF_NO_NAMESPACE
+ HDF_NO_STD
+ BOOL_NOTDEFINED
+ NO_STATIC_CAST
+ CXX_HAVE_OFFSETOF
+ )
+ HDF_CXX_FUNCTION_TEST (${cxx_test})
+ endforeach ()
+endif ()
diff --git a/config/cmake_ext_mod/HDFUseFortran.cmake b/config/cmake_ext_mod/HDFUseFortran.cmake
index 5be2c49..17fdefb 100644
--- a/config/cmake_ext_mod/HDFUseFortran.cmake
+++ b/config/cmake_ext_mod/HDFUseFortran.cmake
@@ -5,7 +5,7 @@
# 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://support.hdfgroup.org/ftp/HDF5/releases.
+# 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.
#
@@ -13,7 +13,13 @@
# This file provides functions for Fortran support.
#
#-------------------------------------------------------------------------------
-ENABLE_LANGUAGE (Fortran)
+enable_language (Fortran)
+set (HDF_PREFIX "H5")
+
+if (NOT CMAKE_VERSION VERSION_LESS "3.14.0")
+ include (CheckFortranSourceRuns)
+ include (CheckFortranSourceCompiles)
+endif ()
#-------------------------------------------------------------------------------
# Fix Fortran flags if we are compiling staticly on Windows using
@@ -41,71 +47,15 @@ file (STRINGS ${CMAKE_BINARY_DIR}/FCMangle.h CONTENTS REGEX "H5_FC_GLOBAL_\\(.*,
string (REGEX MATCH "H5_FC_GLOBAL_\\(.*,.*\\) +(.*)" RESULT ${CONTENTS})
set (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) ${CMAKE_MATCH_1}")
-#-----------------------------------------------------------------------------
-# The provided CMake Fortran macros don't provide a general check function
-# so this one is used for a sizeof test.
-#-----------------------------------------------------------------------------
-macro (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE)
- message (STATUS "Testing Fortran ${FUNCTION}")
- if (CMAKE_REQUIRED_LIBRARIES)
- set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
- "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
- else ()
- set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES)
- endif ()
- file (WRITE
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f90
- "${CODE}"
- )
- TRY_COMPILE (RESULT_VAR
- ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f90
- CMAKE_FLAGS "${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}"
- OUTPUT_VARIABLE OUTPUT
- )
-
-# message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
-# message ( "Test result ${OUTPUT}")
-# message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
-
- if (${RESULT_VAR})
- set (${VARIABLE} 1 CACHE INTERNAL "Have Fortran function ${FUNCTION}")
- message (STATUS "Testing Fortran ${FUNCTION} - OK")
- file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
- "Determining if the Fortran ${FUNCTION} exists passed with the following output:\n"
- "${OUTPUT}\n\n"
- )
- else ()
- message (STATUS "Testing Fortran ${FUNCTION} - Fail")
- set (${VARIABLE} 0 CACHE INTERNAL "Have Fortran function ${FUNCTION}")
- file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Determining if the Fortran ${FUNCTION} exists failed with the following output:\n"
- "${OUTPUT}\n\n")
- endif ()
-endmacro ()
-
-#-----------------------------------------------------------------------------
-# Configure Checks which require Fortran compilation must go in here
-# not in the main ConfigureChecks.cmake files, because if the user has
-# no Fortran compiler, problems arise.
-#
-# Be careful with leading spaces here, do not remove them.
-#-----------------------------------------------------------------------------
-
-# Check for Non-standard extension intrinsic function SIZEOF
-set (FORTRAN_HAVE_SIZEOF FALSE)
-CHECK_FORTRAN_FEATURE(sizeof
+#test code source
+set (SIZEOF_CODE
"
PROGRAM main
i = sizeof(x)
END PROGRAM
"
- FORTRAN_HAVE_SIZEOF
)
-
-# Check for F2008 standard intrinsic function C_SIZEOF
-set (FORTRAN_HAVE_C_SIZEOF FALSE)
-CHECK_FORTRAN_FEATURE(c_sizeof
+set (C_SIZEOF_CODE
"
PROGRAM main
USE ISO_C_BINDING
@@ -114,11 +64,8 @@ CHECK_FORTRAN_FEATURE(c_sizeof
result = c_sizeof(a)
END PROGRAM
"
- FORTRAN_HAVE_C_SIZEOF
)
-
-# Check for F2008 standard intrinsic function STORAGE_SIZE
-CHECK_FORTRAN_FEATURE(storage_size
+set (STORAGE_SIZE_CODE
"
PROGRAM main
INTEGER :: a
@@ -126,22 +73,15 @@ CHECK_FORTRAN_FEATURE(storage_size
result = storage_size(a)
END PROGRAM
"
- FORTRAN_HAVE_STORAGE_SIZE
)
-
-# Check for F2008 standard intrinsic module "ISO_FORTRAN_ENV"
-set (HAVE_ISO_FORTRAN_ENV FALSE)
-CHECK_FORTRAN_FEATURE(ISO_FORTRAN_ENV
+set (ISO_FORTRAN_ENV_CODE
"
PROGRAM main
USE, INTRINSIC :: ISO_FORTRAN_ENV
END PROGRAM
"
- HAVE_ISO_FORTRAN_ENV
)
-
-set (FORTRAN_DEFAULT_REAL_NOT_DOUBLE FALSE)
-CHECK_FORTRAN_FEATURE(RealIsNotDouble
+set (REALISNOTDOUBLE_CODE
"
MODULE type_mod
INTERFACE h5t
@@ -164,14 +104,8 @@ CHECK_FORTRAN_FEATURE(RealIsNotDouble
CALL h5t(d)
END PROGRAM main
"
- FORTRAN_DEFAULT_REAL_NOT_DOUBLE
)
-
-#-----------------------------------------------------------------------------
-# Checks if the ISO_C_BINDING module meets all the requirements
-#-----------------------------------------------------------------------------
-set (FORTRAN_HAVE_ISO_C_BINDING FALSE)
-CHECK_FORTRAN_FEATURE(iso_c_binding
+set (ISO_C_BINDING_CODE
"
PROGRAM main
USE iso_c_binding
@@ -183,15 +117,101 @@ CHECK_FORTRAN_FEATURE(iso_c_binding
ptr = C_LOC(ichr(1:1))
END PROGRAM
"
- FORTRAN_HAVE_ISO_C_BINDING
)
+if (NOT CMAKE_VERSION VERSION_LESS "3.14.0")
+ if (HDF5_REQUIRED_LIBRARIES)
+ set (CMAKE_REQUIRED_LIBRARIES "${HDF5_REQUIRED_LIBRARIES}")
+ endif ()
+ check_fortran_source_compiles (${SIZEOF_CODE} ${HDF_PREFIX}_FORTRAN_HAVE_SIZEOF SRC_EXT f90)
+ check_fortran_source_compiles (${C_SIZEOF_CODE} ${HDF_PREFIX}_FORTRAN_HAVE_C_SIZEOF SRC_EXT f90)
+ check_fortran_source_compiles (${STORAGE_SIZE_CODE} ${HDF_PREFIX}_FORTRAN_HAVE_STORAGE_SIZE SRC_EXT f90)
+ check_fortran_source_compiles (${ISO_FORTRAN_ENV_CODE} ${HDF_PREFIX}_HAVE_ISO_FORTRAN_ENV SRC_EXT f90)
+ check_fortran_source_compiles (${REALISNOTDOUBLE_CODE} ${HDF_PREFIX}_FORTRAN_DEFAULT_REAL_NOT_DOUBLE SRC_EXT f90)
+ check_fortran_source_compiles (${ISO_C_BINDING_CODE} ${HDF_PREFIX}_FORTRAN_HAVE_ISO_C_BINDING SRC_EXT f90)
+else ()
+ #-----------------------------------------------------------------------------
+ # The provided CMake Fortran macros don't provide a general check function
+ # so this one is used for a sizeof test.
+ #-----------------------------------------------------------------------------
+ macro (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE)
+ message (STATUS "Testing Fortran ${FUNCTION}")
+ if (HDF5_REQUIRED_LIBRARIES)
+ set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
+ "-DLINK_LIBRARIES:STRING=${HDF5_REQUIRED_LIBRARIES}")
+ else ()
+ set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES)
+ endif ()
+ file (WRITE
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f90
+ "${CODE}"
+ )
+ TRY_COMPILE (RESULT_VAR
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f90
+ CMAKE_FLAGS "${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}"
+ OUTPUT_VARIABLE OUTPUT
+ )
+
+ # message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
+ # message (STATUS "Test result ${OUTPUT}")
+ # message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
+
+ if (${RESULT_VAR})
+ set (${VARIABLE} 1 CACHE INTERNAL "Have Fortran function ${FUNCTION}")
+ message (STATUS "Testing Fortran ${FUNCTION} - OK")
+ file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Determining if the Fortran ${FUNCTION} exists passed with the following output:\n"
+ "${OUTPUT}\n\n"
+ )
+ else ()
+ message (STATUS "Testing Fortran ${FUNCTION} - Fail")
+ set (${VARIABLE} 0 CACHE INTERNAL "Have Fortran function ${FUNCTION}")
+ file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Determining if the Fortran ${FUNCTION} exists failed with the following output:\n"
+ "${OUTPUT}\n\n")
+ endif ()
+ endmacro ()
+
+ #-----------------------------------------------------------------------------
+ # Configure Checks which require Fortran compilation must go in here
+ # not in the main ConfigureChecks.cmake files, because if the user has
+ # no Fortran compiler, problems arise.
+ #
+ # Be careful with leading spaces here, do not remove them.
+ #-----------------------------------------------------------------------------
+
+ # Check for Non-standard extension intrinsic function SIZEOF
+ set (${HDF_PREFIX}_FORTRAN_HAVE_SIZEOF FALSE)
+ CHECK_FORTRAN_FEATURE(sizeof_code ${SIZEOF_CODE} ${HDF_PREFIX}_FORTRAN_HAVE_SIZEOF)
+
+ # Check for F2008 standard intrinsic function C_SIZEOF
+ set (${HDF_PREFIX}_FORTRAN_HAVE_C_SIZEOF FALSE)
+ CHECK_FORTRAN_FEATURE(c_sizeof_code ${C_SIZEOF_CODE} ${HDF_PREFIX}_FORTRAN_HAVE_C_SIZEOF)
+
+ # Check for F2008 standard intrinsic function STORAGE_SIZE
+ CHECK_FORTRAN_FEATURE(storage_size_code ${STORAGE_SIZE_CODE} ${HDF_PREFIX}_FORTRAN_HAVE_STORAGE_SIZE)
+
+ # Check for F2008 standard intrinsic module "ISO_FORTRAN_ENV"
+ set (${HDF_PREFIX}_HAVE_ISO_FORTRAN_ENV FALSE)
+ CHECK_FORTRAN_FEATURE(iso_fortran_env_code ${ISO_FORTRAN_ENV_CODE} ${HDF_PREFIX}_HAVE_ISO_FORTRAN_ENV)
+
+ set (${HDF_PREFIX}_FORTRAN_DEFAULT_REAL_NOT_DOUBLE FALSE)
+ CHECK_FORTRAN_FEATURE(realisnotdouble_code ${REALISNOTDOUBLE_CODE} ${HDF_PREFIX}_FORTRAN_DEFAULT_REAL_NOT_DOUBLE)
+
+ #-----------------------------------------------------------------------------
+ # Checks if the ISO_C_BINDING module meets all the requirements
+ #-----------------------------------------------------------------------------
+ set (${HDF_PREFIX}_FORTRAN_HAVE_ISO_C_BINDING FALSE)
+ CHECK_FORTRAN_FEATURE(iso_c_binding_code ${ISO_C_BINDING_CODE} ${HDF_PREFIX}_FORTRAN_HAVE_ISO_C_BINDING)
+endif ()
+
#-----------------------------------------------------------------------------
# Add debug information (intel Fortran : JB)
#-----------------------------------------------------------------------------
if (CMAKE_Fortran_COMPILER MATCHES ifort)
- if (WIN32)
- set (CMAKE_Fortran_FLAGS_DEBUG "/debug:full /dbglibs " CACHE "flags" STRING FORCE)
- set (CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG" CACHE "flags" STRING FORCE)
+ if (WIN32 AND NOT MINGW)
+ set (CMAKE_Fortran_FLAGS_DEBUG "/debug:full /dbglibs " CACHE STRING "flags" FORCE)
+ set (CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG" CACHE STRING "flags" FORCE)
endif ()
endif ()
diff --git a/config/cmake_ext_mod/grepTest.cmake b/config/cmake_ext_mod/grepTest.cmake
index b812d73..8538f32 100644
--- a/config/cmake_ext_mod/grepTest.cmake
+++ b/config/cmake_ext_mod/grepTest.cmake
@@ -5,7 +5,7 @@
# 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://support.hdfgroup.org/ftp/HDF5/releases.
+# 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.
#
@@ -20,7 +20,7 @@ endif ()
# message (STATUS "Require TEST_ARGS to be defined")
#endif ()
if (NOT TEST_FOLDER)
- message ( FATAL_ERROR "Require TEST_FOLDER to be defined")
+ message (FATAL_ERROR "Require TEST_FOLDER to be defined")
endif ()
if (NOT TEST_OUTPUT)
message (FATAL_ERROR "Require TEST_OUTPUT to be defined")
@@ -29,17 +29,38 @@ endif ()
# message (STATUS "Require TEST_EXPECT to be defined")
#endif ()
if (NOT TEST_FILTER)
- message (STATUS "Require TEST_FILTER to be defined")
+ message (STATUS "Optional TEST_FILTER to be defined")
endif ()
if (NOT TEST_REFERENCE)
message (FATAL_ERROR "Require TEST_REFERENCE to be defined")
endif ()
-message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}")
+if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}")
+ file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT})
+endif ()
+
+if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
+ file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err)
+endif ()
+
+message (STATUS "COMMAND: ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}")
+
+if (TEST_LIBRARY_DIRECTORY)
+ if (WIN32)
+ set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}")
+ else ()
+ set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}")
+ endif ()
+endif ()
+
+if (TEST_ENV_VAR)
+ set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}")
+ #message (STATUS "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}")
+endif ()
# run the test program, capture the stdout/stderr and the result var
execute_process (
- COMMAND ${TEST_PROGRAM} ${TEST_ARGS}
+ COMMAND ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}
WORKING_DIRECTORY ${TEST_FOLDER}
RESULT_VARIABLE TEST_RESULT
OUTPUT_FILE ${TEST_OUTPUT}
@@ -49,27 +70,130 @@ execute_process (
)
message (STATUS "COMMAND Result: ${TEST_RESULT}")
+
message (STATUS "COMMAND Error: ${TEST_ERROR}")
-# now grep the output with the reference
+# remove special output
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
+string (FIND TEST_STREAM "_pmi_alps" "${TEST_FIND_RESULT}")
+if (TEST_FIND_RESULT GREATER 0)
+ string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
+ file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM})
+endif ()
+
+# if the TEST_ERRREF exists grep the error output with the error reference
+set (TEST_ERRREF_RESULT 0)
+if (TEST_ERRREF)
+ # if the .err file exists grep the error output with the error reference before comparing stdout
+ if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
+ file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_ERR_STREAM)
+ list (LENGTH TEST_ERR_STREAM test_len)
+ if (test_len GREATER 0)
+ # TEST_ERRREF should always be matched
+ string (REGEX MATCH "${TEST_ERRREF}" TEST_MATCH ${TEST_ERR_STREAM})
+ string (COMPARE EQUAL "${TEST_ERRREF}" "${TEST_MATCH}" TEST_ERRREF_RESULT)
+ if (NOT TEST_ERRREF_RESULT)
+ message (FATAL_ERROR "Failed: The error output of ${TEST_PROGRAM} did not contain ${TEST_ERRREF}")
+ endif ()
+ endif ()
+ endif ()
+
+ #always compare output file to reference unless this must be skipped
+ set (TEST_COMPARE_RESULT 0)
+ if (NOT TEST_SKIP_COMPARE)
+ if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}")
+ file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
+ list (LENGTH TEST_STREAM test_len)
+ if (test_len GREATER 0)
+ if (WIN32)
+ configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF)
+ if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp")
+ file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE})
+ endif ()
+ #file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
+ #file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
+ endif ()
+ if (NOT TEST_SORT_COMPARE)
+ # now compare the output with the reference
+ execute_process (
+ COMMAND ${CMAKE_COMMAND} -E compare_files ${CMAKE_IGNORE_EOL} ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE}
+ RESULT_VARIABLE TEST_COMPARE_RESULT
+ )
+ else ()
+ file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1)
+ file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2)
+ list (SORT v1)
+ list (SORT v2)
+ if (NOT v1 STREQUAL v2)
+ set(TEST_COMPARE_RESULT 1)
+ endif ()
+ endif ()
+
+ if (TEST_COMPARE_RESULT)
+ set (TEST_COMPARE_RESULT 0)
+ file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act)
+ list (LENGTH test_act len_act)
+ file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref)
+ list (LENGTH test_ref len_ref)
+ if (len_act GREATER 0 AND len_ref GREATER 0)
+ math (EXPR _FP_LEN "${len_ref} - 1")
+ foreach (line RANGE 0 ${_FP_LEN})
+ list (GET test_act ${line} str_act)
+ list (GET test_ref ${line} str_ref)
+ if (NOT str_act STREQUAL str_ref)
+ if (str_act)
+ set (TEST_COMPARE_RESULT 1)
+ message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
+ endif ()
+ endif ()
+ endforeach ()
+ else ()
+ if (len_act EQUAL 0)
+ message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty")
+ endif ()
+ if (len_ref EQUAL 0)
+ message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty")
+ endif ()
+ endif ()
+ if (NOT len_act EQUAL len_ref)
+ set (TEST_COMPARE_RESULT 1)
+ endif ()
+ endif ()
+ endif ()
-# TEST_REFERENCE should always be matched
-string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM})
-string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT)
-if ("${TEST_RESULT}" STREQUAL "0")
- message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}")
+ message (STATUS "COMPARE Result: ${TEST_COMPARE_RESULT}")
+
+ # again, if return value is !=0 scream and shout
+ if (TEST_COMPARE_RESULT)
+ message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}")
+ endif ()
+ endif ()
+ endif ()
+else ()
+ # else grep the output with the reference
+ set (TEST_GREP_RESULT 0)
+ file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
+
+ # TEST_REFERENCE should always be matched
+ string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM})
+ string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_GREP_RESULT)
+ if (NOT TEST_GREP_RESULT)
+ message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}")
+ endif ()
endif ()
-string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM})
-if ("${TEST_EXPECT}" STREQUAL "1")
- # TEST_EXPECT (1) interperts TEST_FILTER as NOT to match
- string (LENGTH "${TEST_MATCH}" TEST_RESULT)
- if (NOT "${TEST_RESULT}" STREQUAL "0")
- message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}")
+
+if (TEST_FILTER)
+ string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM})
+ if (TEST_EXPECT)
+ # TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match
+ string (LENGTH "${TEST_MATCH}" TEST_GREP_RESULT)
+ if (TEST_GREP_RESULT)
+ message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}")
+ endif ()
endif ()
endif ()
# everything went fine...
-message ("Passed: The output of ${TEST_PROGRAM} matched")
+message (STATUS "Passed: The output of ${TEST_PROGRAM} matched")
diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake
index 2479728..f552dcd 100644
--- a/config/cmake_ext_mod/runTest.cmake
+++ b/config/cmake_ext_mod/runTest.cmake
@@ -5,7 +5,7 @@
# 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://support.hdfgroup.org/ftp/HDF5/releases.
+# 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.
#
@@ -18,7 +18,7 @@ if (NOT TEST_PROGRAM)
message (FATAL_ERROR "Require TEST_PROGRAM to be defined")
endif ()
if (NOT TEST_FOLDER)
- message ( FATAL_ERROR "Require TEST_FOLDER to be defined")
+ message (FATAL_ERROR "Require TEST_FOLDER to be defined")
endif ()
if (NOT TEST_OUTPUT)
message (FATAL_ERROR "Require TEST_OUTPUT to be defined")
@@ -26,27 +26,19 @@ endif ()
if (NOT TEST_EXPECT)
message (STATUS "Require TEST_EXPECT to be defined")
endif ()
-if (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE)
- message (FATAL_ERROR "Require TEST_REFERENCE to be defined")
-endif ()
-if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT})
+if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}")
file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT})
endif ()
-if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
+if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err)
endif ()
-# if there is not an error reference file add the error output to the stdout file
-if (NOT TEST_ERRREF)
- set (ERROR_APPEND 1)
-endif ()
-
-message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}")
+message (STATUS "COMMAND: ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}")
if (TEST_LIBRARY_DIRECTORY)
- if (WIN32 AND NOT MINGW)
+ if (WIN32)
set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}")
else ()
set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}")
@@ -55,12 +47,13 @@ endif ()
if (TEST_ENV_VAR)
set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}")
+ #message (STATUS "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}")
endif ()
if (NOT TEST_INPUT)
# run the test program, capture the stdout/stderr and the result var
execute_process (
- COMMAND ${TEST_PROGRAM} ${TEST_ARGS}
+ COMMAND ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}
WORKING_DIRECTORY ${TEST_FOLDER}
RESULT_VARIABLE TEST_RESULT
OUTPUT_FILE ${TEST_OUTPUT}
@@ -71,7 +64,7 @@ if (NOT TEST_INPUT)
else ()
# run the test program with stdin, capture the stdout/stderr and the result var
execute_process (
- COMMAND ${TEST_PROGRAM} ${TEST_ARGS}
+ COMMAND ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}
WORKING_DIRECTORY ${TEST_FOLDER}
RESULT_VARIABLE TEST_RESULT
INPUT_FILE ${TEST_INPUT}
@@ -87,7 +80,7 @@ if (TEST_REGEX)
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
string (REGEX MATCH "${TEST_REGEX}" REGEX_MATCH ${TEST_STREAM})
string (COMPARE EQUAL "${REGEX_MATCH}" "${TEST_MATCH}" REGEX_RESULT)
- if ("${REGEX_RESULT}" STREQUAL "0")
+ if (NOT REGEX_RESULT)
message (STATUS "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_MATCH}")
endif ()
endif ()
@@ -95,9 +88,24 @@ endif ()
message (STATUS "COMMAND Result: ${TEST_RESULT}")
# if the .err file exists and ERRROR_APPEND is enabled
-if (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
+if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM)
- file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
+ list (LENGTH TEST_STREAM test_len)
+ if (test_len GREATER 0)
+ if (TEST_MASK_FILE)
+ STRING(REGEX REPLACE "CurrentDir is [^\n]+\n" "CurrentDir is (dir name)\n" TEST_STREAM "${TEST_STREAM}")
+ endif ()
+ # remove special output
+ string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
+
+ if (NOT ERROR_APPEND)
+ # write back to original .err file
+ file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}")
+ else ()
+ # append error output to the stdout output file
+ file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
+ endif ()
+ endif ()
endif ()
# append the test result status with a predefined text
@@ -106,9 +114,9 @@ if (TEST_APPEND)
endif ()
# if the return value is !=${TEST_EXPECT} bail out
-if (NOT "${TEST_RESULT}" STREQUAL "${TEST_EXPECT}")
+if (NOT TEST_RESULT EQUAL TEST_EXPECT)
if (NOT TEST_NOERRDISPLAY)
- if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT})
+ if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
message (STATUS "Output :\n${TEST_STREAM}")
endif ()
@@ -118,6 +126,33 @@ endif ()
message (STATUS "COMMAND Error: ${TEST_ERROR}")
+# remove special output
+file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
+string (FIND "${TEST_STREAM}" "_pmi_alps" TEST_FIND_RESULT)
+if (TEST_FIND_RESULT GREATER -1)
+ string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
+ file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM})
+endif ()
+
+# remove special error output
+if (NOT TEST_ERRREF)
+ # the error stack has been appended to the output file
+ file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
+else ()
+ # the error stack remains in the .err file
+ file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM)
+endif ()
+string (FIND "${TEST_STREAM}" "no version information available" TEST_FIND_RESULT)
+if (TEST_FIND_RESULT GREATER -1)
+ string (REGEX REPLACE "^.*no version information available[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
+ # write back the changes to the original files
+ if (NOT TEST_ERRREF)
+ file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
+ else ()
+ file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}")
+ endif ()
+endif ()
+
# if the output file needs Storage text removed
if (TEST_MASK)
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
@@ -128,7 +163,7 @@ endif ()
# if the output file needs Modified text removed
if (TEST_MASK_MOD)
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
- string (REGEX REPLACE "Modified:[^\n]+\n" "Modified: XXXX-XX-XX XX:XX:XX XXX\n" TEST_STREAM "${TEST_STREAM}")
+ string (REGEX REPLACE "Modified:[^\n]+\n" "Modified: XXXX-XX-XX XX:XX:XX XXX\n" TEST_STREAM "${TEST_STREAM}")
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
endif ()
@@ -166,123 +201,177 @@ endif ()
if (TEST_REF_FILTER)
#message (STATUS "TEST_REF_FILTER: ${TEST_APPEND}${TEST_REF_FILTER}")
file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
- STRING(REGEX REPLACE "${TEST_REF_APPEND}" "${TEST_REF_FILTER}" TEST_STREAM "${TEST_STREAM}")
+ string (REGEX REPLACE "${TEST_REF_APPEND}" "${TEST_REF_FILTER}" TEST_STREAM "${TEST_STREAM}")
file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
endif ()
# compare output files to references unless this must be skipped
+set (TEST_COMPARE_RESULT 0)
if (NOT TEST_SKIP_COMPARE)
- if (WIN32 AND NOT MINGW)
+ if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}")
file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
- file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
- endif ()
+ list (LENGTH TEST_STREAM test_len)
+ if (test_len GREATER 0)
+ if (WIN32)
+ configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF)
+ if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp")
+ file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE})
+ endif ()
+ #file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
+ #file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
+ endif ()
- if (NOT TEST_SORT_COMPARE)
- # now compare the output with the reference
- execute_process (
- COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE}
- RESULT_VARIABLE TEST_RESULT
- )
- else ()
- file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1)
- file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2)
- list (SORT v1)
- list (SORT v2)
- if (NOT v1 STREQUAL v2)
- set(TEST_RESULT 1)
- endif ()
- endif ()
+ if (NOT TEST_SORT_COMPARE)
+ # now compare the output with the reference
+ execute_process (
+ COMMAND ${CMAKE_COMMAND} -E compare_files ${CMAKE_IGNORE_EOL} ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE}
+ RESULT_VARIABLE TEST_COMPARE_RESULT
+ )
+ else ()
+ file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1)
+ file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2)
+ list (SORT v1)
+ list (SORT v2)
+ if (NOT v1 STREQUAL v2)
+ set(TEST_COMPARE_RESULT 1)
+ endif ()
+ endif ()
- if (NOT "${TEST_RESULT}" STREQUAL "0")
- set (TEST_RESULT 0)
- file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act)
- list (LENGTH test_act len_act)
- file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref)
- list (LENGTH test_ref len_ref)
- if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0")
- math (EXPR _FP_LEN "${len_ref} - 1")
- foreach (line RANGE 0 ${_FP_LEN})
- list (GET test_act ${line} str_act)
- list (GET test_ref ${line} str_ref)
- if (NOT "${str_act}" STREQUAL "${str_ref}")
- if (NOT "${str_act}" STREQUAL "")
- set (TEST_RESULT 1)
- message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
+ if (TEST_COMPARE_RESULT)
+ set (TEST_COMPARE_RESULT 0)
+ file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act)
+ list (LENGTH test_act len_act)
+ file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref)
+ list (LENGTH test_ref len_ref)
+ if (len_act GREATER 0 AND len_ref GREATER 0)
+ math (EXPR _FP_LEN "${len_ref} - 1")
+ foreach (line RANGE 0 ${_FP_LEN})
+ list (GET test_act ${line} str_act)
+ list (GET test_ref ${line} str_ref)
+ if (NOT str_act STREQUAL str_ref)
+ if (str_act)
+ set (TEST_COMPARE_RESULT 1)
+ message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
+ endif ()
+ endif ()
+ endforeach ()
+ else ()
+ if (len_act EQUAL 0)
+ message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty")
+ endif ()
+ if (len_ref EQUAL 0)
+ message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty")
endif ()
endif ()
- endforeach ()
- else ()
- if ("${len_act}" STREQUAL "0")
- message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty")
- endif ()
- if ("${len_ref}" STREQUAL "0")
- message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty")
+ if (NOT len_act EQUAL len_ref)
+ set (TEST_COMPARE_RESULT 1)
+ endif ()
endif ()
endif ()
- if (NOT "${len_act}" STREQUAL "${len_ref}")
- set (TEST_RESULT 1)
- endif ()
- endif ()
- message (STATUS "COMPARE Result: ${TEST_RESULT}")
+ message (STATUS "COMPARE Result: ${TEST_COMPARE_RESULT}")
- # again, if return value is !=0 scream and shout
- if (NOT "${TEST_RESULT}" STREQUAL "0")
- message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}")
+ # again, if return value is !=0 scream and shout
+ if (TEST_COMPARE_RESULT)
+ message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}")
+ endif ()
endif ()
# now compare the .err file with the error reference, if supplied
+ set (TEST_ERRREF_RESULT 0)
if (TEST_ERRREF)
- if (WIN32 AND NOT MINGW)
- file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM)
- file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}")
- endif ()
+ file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM)
+ list (LENGTH TEST_STREAM test_len)
+ if (test_len GREATER 0)
+ if (WIN32)
+ configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF)
+ if (EXISTS "${TEST_FOLDER}/${TEST_ERRREF}.tmp")
+ file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF})
+ endif ()
+ #file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM)
+ #file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}")
+ endif ()
- # now compare the error output with the error reference
- execute_process (
- COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF}
- RESULT_VARIABLE TEST_RESULT
- )
- if (NOT "${TEST_RESULT}" STREQUAL "0")
- set (TEST_RESULT 0)
- file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act)
- list (LENGTH test_act len_act)
- file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref)
- list (LENGTH test_ref len_ref)
- math (EXPR _FP_LEN "${len_ref} - 1")
- if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0")
+ # now compare the error output with the error reference
+ execute_process (
+ COMMAND ${CMAKE_COMMAND} -E compare_files ${CMAKE_IGNORE_EOL} ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF}
+ RESULT_VARIABLE TEST_ERRREF_RESULT
+ )
+ if (TEST_ERRREF_RESULT)
+ set (TEST_ERRREF_RESULT 0)
+ file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act)
+ list (LENGTH test_act len_act)
+ file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref)
+ list (LENGTH test_ref len_ref)
math (EXPR _FP_LEN "${len_ref} - 1")
- foreach (line RANGE 0 ${_FP_LEN})
- list (GET test_act ${line} str_act)
- list (GET test_ref ${line} str_ref)
- if (NOT "${str_act}" STREQUAL "${str_ref}")
- if (NOT "${str_act}" STREQUAL "")
- set (TEST_RESULT 1)
- message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
- endif ()
+ if (len_act GREATER 0 AND len_ref GREATER 0)
+ math (EXPR _FP_LEN "${len_ref} - 1")
+ foreach (line RANGE 0 ${_FP_LEN})
+ list (GET test_act ${line} str_act)
+ list (GET test_ref ${line} str_ref)
+ if (NOT str_act STREQUAL str_ref)
+ if (str_act)
+ set (TEST_ERRREF_RESULT 1)
+ message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
+ endif ()
+ endif ()
+ endforeach ()
+ else ()
+ if (len_act EQUAL 0)
+ message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty")
+ endif ()
+ if (len_ref EQUAL 0)
+ message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty")
endif ()
- endforeach ()
- else ()
- if ("${len_act}" STREQUAL "0")
- message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty")
endif ()
- if ("${len_ref}" STREQUAL "0")
- message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty")
+ if (NOT len_act EQUAL len_ref)
+ set (TEST_ERRREF_RESULT 1)
endif ()
endif ()
- if (NOT "${len_act}" STREQUAL "${len_ref}")
- set (TEST_RESULT 1)
- endif ()
endif ()
- message (STATUS "COMPARE Result: ${TEST_RESULT}")
+ message (STATUS "COMPARE Result: ${TEST_ERRREF_RESULT}")
# again, if return value is !=0 scream and shout
- if (NOT "${TEST_RESULT}" STREQUAL "0")
+ if (TEST_ERRREF_RESULT)
message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}")
endif ()
endif ()
endif ()
+set (TEST_GREP_RESULT 0)
+if (TEST_GREP_COMPARE)
+ # now grep the output with the reference
+ file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
+ list (LENGTH TEST_STREAM test_len)
+ if (test_len GREATER 0)
+ # TEST_REFERENCE should always be matched
+ string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM})
+ string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_GREP_RESULT)
+ if (NOT TEST_GREP_RESULT)
+ message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}")
+ endif ()
+
+ string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM})
+ if (TEST_EXPECT)
+ # TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match
+ string (LENGTH "${TEST_MATCH}" TEST_GREP_RESULT)
+ if (TEST_GREP_RESULT)
+ message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}")
+ endif ()
+ endif ()
+ endif ()
+endif ()
+
+# dump the output unless nodisplay option is set
+if (TEST_SKIP_COMPARE AND NOT TEST_NO_DISPLAY)
+ file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
+ execute_process (
+ COMMAND ${CMAKE_COMMAND} -E echo ${TEST_STREAM}
+ RESULT_VARIABLE TEST_RESULT
+ )
+endif ()
+
# everything went fine...
-message ("Passed: The output of ${TEST_PROGRAM} matches ${TEST_REFERENCE}")
+message (STATUS "${TEST_PROGRAM} Passed")
+