hdf5/CMakeLists.txt
jhendersonHDF ea3f926057
1.14 sync with develop (#3660)
* Rework tools.cmake and add C flags (#3110)

* Fix gh pages so that the doxygen files are uploaded (#3102)

* Add workspace path
* add debug
* Make one job so workspace files are available
* Put doxygen docs under docs folder in gh-pages

* Fix a misc warning in test/vol.c (#3112)

The compiler complains about using integers instead of size_t
for some sizes.

* Remove H5detect and H5make_libsettings (#3104)

Removes H5detect and H5make_libsettings from the build and replaces
their functionality with things that don't affect cross-compiling.

H5detect --> floating-point types are now detected on library load
H5make_libsettings --> Moved functionality to a new H5build_settings.c template file

* clang-tidy clang-analyzer-core issues addressed (#3113)

src/H5system.c:1293:13: warning: Dereference of null pointer
[clang-analyzer-core.NullDereference]
src/H5trace.c:4048:17: warning: Passed-by-value struct argument contains
uninitialized data (e.g., via the field chain: 'initial.user')
[clang-analyzer-core.CallAndMessage]

* Add note for issue 3056 (#3117)

* Use 1.14 toolchain (#3116)

* Remove the checkposix script (#3122)

This script was used to ensure that all non-HDF5 calls were prefixed
with 'HD'. We are removing this scheme so this script is no longer
needed.

* Remove unused HD macros (#3120)

* Remove unused HD macros
The library prefixes most C and POSIX API calls with 'HD'. We are
going to start removing these so the code looks like normal C.

This PR removes most of the unused HD markup macros.

* Replace ntohl/ntohs

* Adds an optional version arg to bin/format_source (#3119)

* Clean up mirror VFD code in utils dir (#3121)

* Remove dead code
* Replace mybzero with memset
* Replace hbool_t/TRUE/FALSE with bool/true/false

* Fix spelling issues flagged by codespell (#3130)

* Make autogen.sh output message consistent (#3128)

* Add Python for HDF-EOS zoo description (#3129)

* Fix function name in comment in ros3 VFD (#3131)

* Revert long double checks (#3133)

* Revert "Remove long double conversion work-arounds (#3097)"

This reverts commit 1e1dac1dac.

* Update comments to reflect newer systems

* Add java options to build scripts (#3127)

* Add java options to build scripts

Previously, cmakehdf5 turned on compiling of the java interface
by default due to a value set in cacheinit.cmake.

Now, consistent with how Fortran and CPP interfaces are handled,
the script overwrites this default value to disable the libraries,
fixing #2958.

I also implemented the --enable-java/--disable java options for
cmakehdf5, and -java for buildhdf5.

Allen said these scripts should mention that
compilers are to be specified in environment variables, but missing
compilers causes errors at the CMake level, and
CMake's error messages are already pretty informative (See the one
in #2958 about JAVA_COMPILER).

* Removed .lnt linter files (#3143)

These were last usefully modified in 2004

* Fix path to libhdf5.settings in cmakehdf5 (#3140)

* Many clang -Wextra-semi-stmt fixes (#2537)

* Adds semicolons to function-like macros
* Adds a do..while(0) loop to some macros
* Removes semicolons when inappropriate, especially H5E_TRY_BEGIN/END

* Remove HD prefix from network calls (#3142)

HDsocket(), etc. Only affects the mirror VFD and its test code.

* Remove hbool_t/TRUE/FALSE from java (#3145)

Replaces with bool/true/false

* CMake: (feature) ROS3 and cmake config file. (#3146)

- Added a cmake variable to the hdf5-config.cmake file which
  indicate if the library has been build with or without the
  read-only S3 functionality.

* Define minimal permissions for new GitHub workflows (#3147)

* Track s3 i/o when S3COMMS_DEBUG enabled (#3139)

* Track s3 i/o when S3COMMS_DEBUG enabled

* Fix the snapshots workflow (#3148)

* Add upload url as artifact
* Change doxygen path and comment log-url upload
* zip doxygen files for upload
* add workspace var

* chore: fix grammar (#3150)

* chore: fix grammar

* Removes the HD prefix from java C99 calls (#3149)

POSIX calls (HDstrndup, etc.) are unchanged

* Correct the zip usage (#3153)

* Many fixes to various compiler warnings (#3124)

* Fixed various -Wmissing-variable-declarations by adding static keyword
* In a few cases, renamed the variable suffix from _g to _s.
* Fixed some -Wmissing-variable-declarations by using different declaration macros
* Fixed various -Wconditional-uninitialized warnings by just initializing variable to zero
* Fixed various -Wcomma warnings
* Fixed clang -Wstrict-prototypes warnings
* Fixed various -Wunused-variable warnings
* Updated some casts to fix the only 3 -Wcast-qual warnings
* Fixed the only -Wsometimes-uninitialized warning

* Create Security Policy (#3152)

* Fix #1978 h5vers usage message. (#3162)

Update Platforms Tested in RELEASE.txt.

* speed-up building HDF5 (#3087)

Disables building the tests when building the netCDF, etc.

* Remove dead code behind #ifdef OLD_WAY (#3163)

* Remove H5F_evict_tagged_metadata() (#3165)

The rest of the library just calls H5AC_evict_tagged_metadata()
directly.

* Add missing space in zip command (#3167)

* Fixed check for a VOL's async compatibility  (#3164)

* cap flag fix in test

* added async comp. output

* Update Linux workflows (#3173)

* Consolidate environment setup
* Turn on ros3 VFD in CMake (Linux only)

* Add gh-pages doxygen link (#3175)

* Fix the doxygen to gh pages and artifact creation (#3176)

* Tidy the list of options in main.yml (#3181)

* Remove HD/hbool_t from fortran (#3182)

* Remove HD/hbool_t from high-level lib (#3183)

* Remove HDva_(arg|copy|end|start) (#3184)

* Drop HD prefix & hbool_t from H5TS (#3180)

* Remove HD from fork/exec*/wait* (#3190)

These are not C99 but are hidden behind ifdefs and are highly
unlikely to ever have non-POSIX equivalents.

* Fix assertion failure when attempting to use IOC VFD directly (#3187)

* Rename HDqsort() to qsort() (#3193)

* Rename HDqsort() to qsort()

* Committing clang-format changes

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>

* Rename HDpipe() to pipe() (#3192)

Pipe is POSIX but implemented in Microsoft's CRT

* Rename HDassert() to assert() (#3191)

* Change HDassert to assert

* Fix bin/make_err

* Rename HD(f)printf() to (f)printf() (#3194)

* Add note about HDF5_VOL_CONNECTOR to tools usage (#3159)

* Rename HDsystem() to system() (#3197)

system() is only used in the iopipe test and the things it calls
(which are POSIX-y) are protected by an ifdef.

* Remove HD from HDposix_memalign() (#3196)

The posix_memalign call is only used in the direct VFD, which can only
be built if posix_memalign() is available.

* Remove HD from memory allocate/free calls (#3195)

* HDcalloc
* HDfree
* HDmalloc
* HDrealloc

* chore: fix grammar (#3207)

* docs: remove redundancy in Data Transfer section of user guide (#3208)

* Remove checks for setsysinfo, which is unused (#3205)

* Autotools
* CMake

* Remove HD from protected POSIX calls (#3203)

These calls are non-C99 but protected by ifdefs and have no Windows
equivalents:
* HDalarm
* HDasprintf
* HDclock_gettime
* HDfcntl
* HDgethostname
* HDgetrusage
* HDsymlink

* Rename HDato*() to ato*() (#3201)

* Remove some "Programmer" comments (#3209)

These are meaningless noise.

Removes the "Programmer" lines on comment start lines:

    /* Programmer: John Smith

These complicate my sed script that will rip out the rest of
the comments.

* Rename HDexit() and related to exit(), etc. (#3202)

* HDatexit
* HDexit
* HD_exit

* Remove HD from strto* calls (#3204)

* HDstrtod
* HDstrtol
* HDstrtoll
* HDstrtoul
* HDstrtoull
* HDstrtoumax

* Remove HD from C std lib file ops (#3206)

* HDfclose
* HDferror
* HDfeof
* HDfflush
* HDfopen
* HDfread
* HDfwrite

* Remove programmer/date from comments (#3210)

* Removes Programmer: and Date: fields
* Fixes a few Modifications: fields leftover from previous work

* Remove HD from HDmem* calls (#3211)

* Remove HD from HDis* (e.g., isalpha) (#3212)

* HDisalnum
* HDisalpha
* HDiscntrl
* HDisdigit
* HDisgraph
* HDislower
* HDisprint
* HDispunct
* HDisspace
* HDisupper
* HDisxdigit

* Update actions for release option, fix branch for daily build (#3185)

* Update actions for release option, fix branch for daily build

* Scheduled workflows run on latest commit on the develop

* Add snapshots location

* docs: improve consistency in verb form (#3076) (#3188)

* fix gh action if statements (#3213)

* Adjust presets timeout and fix build script VS versions (#3215)

* Several ros3vfd logging improvements

* Committing clang-format changes

* Update COPYING (#3231)

Fixed old support URL.

* addresses compilation fortran warnings on Frontier (#3236)

* Fix doc for H5allocate_memory (#3240)

* merge bbrelease to release (#3232)

* merge bbrelease to release

* Fix pre-req workflow

* Replace support.hdfgroup.org URLs for alternative COPYING file (#3228)

* Replace support.hdfgroup.org URLs for alternative COPYING file
locations in copyright headers with https://www.hdfgroup.org/licenses.
Replace  support.hdfgroup.org URL for alternative COPYING_LBNL_HDF5
with github URL.
Tweak chkcopyright script for change from UICOPYRIGHTSTR to
THGCOPYRIGHTSTR.

* Replace 1_10 reference with develop branch (#3227)

* Switch CI to use release script (#3242)

* Subfiling VFD source cleanup (#3241)

* Subfiling VFD source cleanup

Modularize Subfiling CMake code into separate CMakeLists.txt file

Update Mercury util code to latest version and update Copyright

Generate mercury_util_config.h header file instead of using
pre-generated file

Remove unnecessary Mercury functionality

Fix minor warning in Subfiling VFD code

* Remove Mercury headers from Autotools publicly-distributed header list

* install h5fuse.sh in bin dir. (#3244)

* Disable h5py until fixed properly without spack (#3243)

* ROS3: (feature) Temporary security credentials (#3030)

- Implemented support for AWS temporary security credentials.
  For this kind of credentials also a session/security token
  should be included in the request by adding the
  x-amz-security-token header.

Co-authored-by: Larry Knox <lrknox@hdfgroup.org>
Co-authored-by: Jordan Henderson <jhenderson@hdfgroup.org>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>

* Avoid truncating at null byte when copying to std::string (#3083)



---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>

* Fix CMake builds when Subfiling VFD isn't enabled (#3250)

* Fix CMake builds when Subfiling VFD isn't enabled

* Add Subfiling VFD entry to hdf5-config.cmake.in

* Fix some warnings in developer builds (#3247)

* Fix some warnings in developer builds

* Switch approach to Winline flag

* Fixed more warnings about extra semicolons (#3249)

* Require semi-colon after H5_CHECK_OVERFLOW calls



Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>

* Fix warning in H5C__UPDATE_STATS_FOR_DIRTY_PIN macro (#3259)

Add braces to H5C__UPDATE_STATS_FOR_DIRTY_PIN macro to fix warning
causing Werror Release builds to fail

* Update DEFAULT_API_VERSION documentation for CMake (#3255)

* Update DEFAULT_API_VERSION documentation for CMake

* Fix hint

---------

Co-authored-by: Larry Knox <lrknox@hdfgroup.org>

* changed the scope of #ifdef DOXYGEN to now include H5D multi-functions (#3254)

* Option changed but not all references (#3252)

* Option changed but not all references

* remove quotes from binary var

* Move 1.12.3 release to October (#3263)

* Fixed some -Wunused-variable warnings and one Wsometimes-uninitialized warning (#3260)

* removed the use of encoded single apostrophe (#3261)

* removed the use of encoded single apostrophe, and fix H5Dread_chunk from write to read

* updated sanitizer paragraph
* fixed brief description for H5Fget_info

* ROS3: (fix) Replaced HDfprintf (#3266)

- Replaced the HDfprintf() functions by fprintf() to be consistent
  with other parts of the library.

* chore: make VRFY output consistent (#3268)

* CMake: (fix) Threads dependency (#3267)

- If the HDF5 library has been build with either thread-safety or
  subfiling VFD feature on it will have an additional dependency
  on a threading library. This dependency has been added to the
  hdf-config.cmake.in file.

* chore: fix grammar - get hang -> get hung (#3272)

* Another round of fixing -Wextra-semi-stmt warnings (#3264)



Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>

* chore: fix typo - persent -> present (#3273)

* Remove py-pip from h5py action (#3265)

* Update release schedule (#3317)

* Move 1.12.3 to November
* Add 1.14.3 in October

* Update README.md w/ 1.4.3 info (#3318)

* Switch parallel compression to use vector I/O (#3245)

Updates parallel compression feature to use vector I/O instead of
creating and passing down MPI derived types to VFD

* Fix incorrect error check in H5Ofill.c for undefined fill values (#3312)

* Fix H5Otoken_to_str call in h5dump and other minor cleanup (#3314)

* Fix loading plugin fails with missing directory GH issue #3248 (#3315)

* Made HGOTO_ERROR a do-while loop (#3308)

* Made HGOTO_ERROR a do-while loop

* Update files to skip list and ignore_words_list  (#3321)

* Update files to skip list and ignore_words_list for codespell to not
check files generated by autotools.  Autotools generate misspellings
that can't be fixed in HDF5 code.

* Windows runtime items go into the bin folder (#3320)

* A couple of documentation items to fix (#3332)

* Fix h5repack for variable-length datatyped datasets (#3331)

* Fix CVE-2018-11202 (#3330)

A malformed file could result in chunk index memory leaks. Under most
conditions (i.e., when the --enable-using-memchecker option is NOT
used), this would result in a small memory leak and and infinite loop
and abort when shutting down the library. The infinite loop would be
due to the "free list" package not being able to clear its resources
so the library couldn't shut down. When the "using a memory checker"
option is used, the free lists are disabled so there is just a memory
leak with no abort on library shutdown.

The chunk index resources are now correctly cleaned up when reading
misparsed files and valgrind confirms no memory leaks.

* Fix CVE-2018-13867 (#3336)

* Fixes the last of the -Wextra-semi-stmt warnings (#3326)

* Fixed extra semi warning by adjusting alternative macro definitions

* Find-replace H5E_END_TRY; -> H5E_END_TRY

* Made H5Epush_goto a do-while loop, fixed indentation

* Made GOTOERROR and ERRMSG do-while loops

* Made Hgoto_error and Hgoto_done  do-while loops

* Made vrfy_cint_type and vrfy_ctype  do-while loops

* Made TEST_TYPE_CONTIG and others do-while loops

* Removed extraneous semi-colons

* Committing clang-format changes

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>

* Fix a typo in RELEASE.txt

* Fix assertion failure in H5D__mpio_collective_filtered_vec_io (#3340)

* Make h5dump spacing consistent when printing VLEN datatype (#3351)

* Fix for the bug exposed from running test/set_extent.c when selection… (#3319)

* Fix for the bug exposed from running test/set_extent.c when selection I/O is enabled.
This is a fix from Neil.
The test/set_extent.c is modified to test for selection I/O enabled.

* Add Fortran ES module to deploy list (#3341)

* Add Fortran ES module to deploy list

* Change fortran mod file export to use a list of names

* test(parallel): verify FALSE case (#3356)

* Implementation of the mpio driver with selection I/O. (#3222)

* This changes the default selection I/O to on for MPIO.

* Work around a testphdf5 failure on Cray MPICH machines (#3361)

* set H5_PAC_C_MAX_REAL_PRECISION default to 0 when cross sompiling with (#3364)

CMake to fix Fortran build failures.

* Add RELEASE.txt notes for recent selection I/O work. (#3374)

* Fix possible performance regression introduced with in-place type conversion in 1.14.2 (#3376)

* Correct script (#3377)

* Correct CI settings (#3384)

* Correct CI settings

* Correct plugin file name

* restore CI tarball name prefix to match bin/release (#3385)

* Fix assertion failure during file close on error (#3387)

* Fix compile failures with H5C_DO_MEMORY_SANITY_CHECKS enabled (#3388)

* Fix valgrind warning about write of uninitialized bytes (#3389)

* Fix valgrind warning about write of uninitialized bytes in ScaleOffset filter (#3390)

* Update presets, examples uncompress, szip cache (#3391)

* Fix serial to parallel chunked dataset file space allocation bug (#3394)

* chore: fix typo (#3405)

* Fix for CVE-2016-4332 (#3406)

This CVE issue was previously listed as fixed (via HDFFV-9950) back in
2016, but with no confirmation test. Now that test files exist for
the 2016 Talos CVE issues, we found that CVE-2016-4332 can raise an
assert in debug builds.

This fix replaces the assert with pointer checks that don't raise
errors or asserts. Since the function is in cleanup code, we do our
best to close and free things, even when presented with partially-
initialized structs.

Fixes CVE-2016-4332 and HDFFV-9950 (confirmed via the cve_hdf5 repo)

* Fix ph5diff tests for MPIEXEC_MAX_NUMPROCS=1 (#3407)

* Enable szip by default in Autotools (#3412)

Since libaec is so prevalent and BSD-licensed for both encode and
decode, we build the szip filter by default when the szip or aec
libraries are found.

* Re-enable SZIP default to ON in CMake (#3414)

The Autotools were handled in a separate commit

* Fix Heap-buffer-overflow WRITE in H5MM_memcpy (#3368)

* Add Intel oneAPI actions (#2949) (#2977)

* ci: add Intel oneAPI actions (#2949)

* ci: fix CMake installation

* ci: use absolute paths for libtool installation

* ci(oneAPI): update compiler versions and use cron

* Add RELEASE.txt entry for compound performance regression fix (#3376) (#3416)

* chore: remove gubbins comment (#3420)

* Add other types and full type to enum/str/vlen dataformat for structblock[begin/end] (#3353)

* Avoid H5Ocopy in h5repack for variable-length string types (#3419)

* Skip atomicity tests for OpenMPI major versions < 5 (#3421)

* Fix an issue with use of uninitialized memory in trefer_deprec.c test (#3422)

* Add parallel examples in doxygen (#3413)

* Fix use of uninitialized value in testpar/t_dset.c test (#3423)

* Remove extraneous "33" in RELEASE.txt (#3425)

* Revise file close assertion failure fix (#3418)

* Remove intel oneapi warning (#3426)

* Fix for CVE-2018-15671.  h5stat -S $POC will result in a crash with segmenetation fault. (#3427)

It is because the object in the testfile points back to the root group.
When the tool tries to traverse the object, it goes back to the root group and then back again.

* chore: match function call and VRFY() output (#3428)

* Fix the Fortran extension used in example links (#3430)

* Put H5T_CONV_ab macros in do..while loops (#3432)

Ever since a recent round of macro cleanup, bin/trace and clang-format
have been bickering over what H5Tconv.c should look like and neither
produces readable code.

This change puts the top-level H5T_CONV_ab macros in do..while loops,
adds appropriate semicolons, and adds the missing H5_CLANG_DIAG_ON|OFF
and H5_GCC_CLANG_DIAG_ON|OFF macros to the list of statement macros
clang-format recognizes. H5Tconv.c is now readable and both bin/trace
and clang-format are happy.

* Convert some H5MM calls to standard C equivalents (#2382)

* H5MM_calloc and malloc are now mapped to stdlib C calls
* H5MM_memcpy now maps directly to memcpy in release builds
* H5MM_memcpy is still implemented as a separate function that
   checks for buffer overlap when H5MM_DEBUG is defined
   (default w/ debug builds)
* Switches many library memcpy calls to use H5MM_memcpy
* Fixes a possible zero allocation in H5Olayout.c

* Add 1.14.4 to the release schedule (#3434)

* Output stderr file in CMake testing on failure (#3431)

* Add Intel oneAPI badges (#3433)

* Add a CVE regression test action (#3445)

*

* Disable SZIP for Intel oneAPI Action (#3449)

* Disable SZIP for Intel oneAPI Action

* Disable Fortran and parallel

* Update VOL CMake for REST VOL (#3450)

* Update VOL CMake for REST VOL

* Prevent linking static libs to VOLs

* Add an h5py badge to README.md (#3477)

* Removed all the ranks printing out testing information (#3457)

* Fix Subfiling VFD IOC assignment bug (#3456)

* Correct java test dimension (#3482)

* Support CMake VOL builds with FetchContent from local directory (#3455)

* Update VOL CMake for REST VOL

* Prevent linking static libs to VOLs

* index on fetch_local: 5c5c3f1505 Prevent linking static libs to VOLs

* index on (no branch): 9a36d3e7b1 On fetch_local: WIP:add source dir fetch option for vols

* Allow building of VOL from local source

* Move LOCAL_DIR option to HDF5_VOL_ALLOW_EXTERNAL

* Fix the Fortran include dir in install config files (#3454)

* Convert hbool_t --> bool in examples (#3492)

* Fix some minor formatting for consistency (#3499)

* Create scorecard.yml (#3508)

Bring in OSSF Scorecard code scanner as a GitHub action

* Convert hbool_t --> bool in testpar (#3495)

* hbool_t/TRUE/FALSE --> bool/true/false in tools (#3491)

* Convert hbool_t --> bool in test (#3494)

* Convert hbool_t --> bool in src (#3496)

* hbool_t --> bool in src

* Does not remove TRUE/FALSE
* Public header files are unchanged
* Public API calls are unchanged

* TRUE/FALSE --> true/false in src

* Add deprecation notice for hbool_t

* Added new Fortran API wrappers (#3511)

* Added new wrappers for
h5get_free_list_sizes_f
H5Sselect_intersect_block_f
H5Sselect_shape_same_f
h5pget_no_selection_io_cause_f
h5pget_mpio_no_collective_cause_f
H5Lvisit_by_name_f
H5Lvisit_f
H5Fget_info_f
h5dwrite_chunk_f
h5dread_chunk_f

* added h5pget_file_space_page_size_f, h5pset_file_space_page_size_f, h5pget_file_space_strategy_f, h5pset_file_space_strategy_f, h5info tests

* added fortran tests

* Update tH5F.F90

* misc. fortran fixes for failing CI dailty tests (#3523)

* fixed H5Lvisit* interface

* changed integer type for direct write

* Consistent initialization of hid_t in the tests (#3521)

* Fix windows cpack with debug (#3525)

* Add missing row for the ROS3 VFD in table #3415 (#3517)

* fixed nvidia compiler issue (#3527)

* Identify functions in a subgroup (#3530)

* quiet warning on sunspot (gcc 11.2.0) (#3534)

* Add API examples doxygen page (#3500)

* removed C_INT32_T from Fortran APIs (#3537)

* Add NVHPC 23.7 GitHub Actions (#3509)

* Add NVHPC 27.3 GitHub Actions

* Address @derobins review

* Remove HD prefix from math functions (#3538)

* Remove HD prefix from HDlog10 calls (#3539)

Was missed in a previous commit and causes building subfiling to
fail.

* fixed arg to C H5Dwrite_chunk (#3541)

* Strip HD prefix from string/char C API calls (#3540)

* Strip HD prefix from string/char C API calls

* HD(f)(put|get)(s|c)
* HDstr*
* HDv*printf
* HD(s)(print|scan)f
* HDperror

But NOT:

* HDstrcase*
* HDvasprintf
* HDstrtok_r
* HDstrndup

As those are not C99 and have portability work-around
implementations. They will be handled later.

* Fix th5_system.c screwup

* Convert main.yml CI into callable workflows (#3529)

* Fix broken URL. (#3546)

* Fix grammar (#3545)

* Update oneAPI-C/A badge yml links. (#3564)

* Check return values from HDF5 API calls. (#3556)

* Adds link to h5fuse.sh in testpar for autotools (#3557)

* Make the h5fuse.sh utility available to parallel subfiling tests so h5fuse testing is not skipped.

* Some minor formatting and text changes (#3563)

* Fix typos and grammar in t_pread. (#3565)

* Fix typo (givin->given) in test/testframe.c. (#3567)

* Fix ifx unused variable hdferr warning. (#3568)

* Correct comments about H5Z_FILTER_NONE (#3572)

* Update release script. (#3577)

* fixed function declaration (#3579)

* Fixed GH-3554 (#3584)

Removed the extra condition

* Remove h5dwalk.1 man page. (#3589)

* Removed the use of -commons linking option on Darwin (#3581)

Removed the use of -commons linking option on Darwin as COMMON and EQUIVALENCE is no long used

* Fix docs for H5Pset_dxpl_mpio_collective_opt() (#3594)

* Fix typo: arange->arrange in src/H5Cmpio.c. (#3597)

* Fix docs for H5Acreate2 and H5Acreate_by_name (#3598)

* Use HDoff_t with lseek consistently (#3600)

lseek on Windows uses __int64 for both the offset and return type
instead of off_t like most POSIX systems. This changes ensures we
use HDoff_t (which is typdef'd correctly on Windows) w/ lseek.

* Replaces HDgetenv with getenv (#3599)

* Develop tools move (#3580)

Reorganizes the tools files to support the VOL tests

* Clean up Subfiling VFD header doxygen formatting (#3601)

* Remove `sh` to run bash script. (#3590)

* Correct path name of ddl file to be changed (#3607)

* Fix potential uninitialized variable (#3602)

Moves a union initialization up a bit so it's performed before code
that can jump to the cleanup target, where file descriptors could
be checked without being initialized.

This could only happen in test code and only in an out-of-memory
situation.

Fixes Coverity 1542254

* Remove unnecessary assignment in test generator (#3603)

Fixes what looks like a copy/paste/modify error in the format convert
test file generator, where an array element is assigned one value
and them immediately overwritten by another value.

Fixes Coverity issue 1542285

* Remove useless define TRUE/FALSE statements. (#3604)

* Fix typo behaviour and dependes. (#3605)

* Fix typos (#3609)

* Fixed unused variable in H5CS.c (#3552) (#3612)

* Fixed #3552

* Fix grammar (#3614)

* Cleanup unused statements (#3553) (#3617)

Removed unnecessary assert statements and noise comments.

* Fix Intel oneAPI icc warning (#3619)

* Fix several spelling/grammar issues (#3621)

* Add HPC CDash to README.md (#3623)

* Disable static + thread-safe on Windows w/ CMake (#3622)

The thread-safety feature on Windows requires a hook in DllMain() and
thus is only available when HDF5 is built as a shared library.

This was previously a warning, but has now been elevated to a fatal
error that cannot be overridden with ALLOW_UNSUPPORTED.

Fixes GitHub #3613

* Remove unused member from H5D_shared_t struct. (#3628)

* Remove old EXTERNALPROJECT_ADD in favor of FETCH_CONTENT (#3624)

* Fix grammar (#3635)

* Disambiguate error output messages. (#3634)

* Disambiguate error output messages.

* Address @brtnfld review.

* Fail CMake on Windows when sub-filing VFD is enabled (#3636)

* Improve consistency in past tense usage (#3638)

* Split out test logic to separate file (#3639)

* Drop MPI-2 support (#3643)

* Switch IEEE flags for NAG Fortran (#3644)

Default is -ieee=stop, which causes problems when the H5T
module performs floating-point type introspection.

The new mode is -ieee=full

* Remove 1.10.11 info from README.md (#3646)

* Fixes GH#1027 compilation error (#3654)

* Remove 1.10 badge (#3650)

* Use real URLs and updated names for plugins (#3651)

* synchronize TGZ naming convention/usage

* Update parallel compression feature to support multi-dataset I/O (#3591)

* Add more tests for selection I/O. (#3528)

* Adjust 1.14 files after merging

---------
2023-10-12 11:32:23 -05:00

1139 lines
52 KiB
CMake

cmake_minimum_required (VERSION 3.18)
project (HDF5 C)
if (POLICY CMP0074)
# find_package() uses <PackageName>_ROOT variables.
cmake_policy (SET CMP0074 NEW)
endif ()
if (POLICY CMP0083)
# To control generation of Position Independent Executable (PIE) or not,
# some flags are required at link time.
cmake_policy (SET CMP0083 NEW)
endif ()
# Avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24:
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
cmake_policy(SET CMP0135 NEW)
endif()
#-----------------------------------------------------------------------------
# Instructions for use : Normal Build
#
# For standard build of HDF5 libraries,tests and tools.
# Run cmake using the HDF5 source tree to generate a build tree.
# Enable/Disable options according to requirements and
# set CMAKE_INSTALL_PREFIX to the required install path.
# Make install can be used to install all components for system-wide use.
#
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
message (FATAL_ERROR "\nERROR! ${PROJECT_NAME} DOES NOT SUPPORT IN SOURCE BUILDS!\n"
"CMAKE_CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}"
" == CMAKE_CURRENT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}\n"
"NEXT STEPS:\n"
"(1) Delete the CMakeCache.txt file and the CMakeFiles/ directory\n"
" under the source directory for ${PROJECT_NAME}, otherwise you\n"
" will not be able to configure ${PROJECT_NAME} correctly!\n"
" * For example, on linux machines do:\n"
" $ rm -r CMakeCache.txt CMakeFiles/\n"
"(2) Create a different directory and configure ${PROJECT_NAME} in that directory.\n"
" * For example, on linux machines do:\n"
" $ mkdir MY_BUILD\n"
" $ cd MY_BUILD\n"
" $ cmake [OPTIONS] ..\n"
)
endif ()
#-----------------------------------------------------------------------------
# Instructions for use : Sub-Project Build
#
# To include HDF5 as a sub-project within another project.
# Set HDF5_EXTERNALLY_CONFIGURED to 1 in the parent project and
# supply values for the following variables...
#
# HDF5_EXPORTED_TARGETS :
# Set this to the name of the targets variable which controls exports
# If unset (because parent project does not support/use the
# install (EXPORT target...) syntax), then targets are not configured
# for export during install.
#
# HDF5_LIB_DEPENDENCIES :
# If the build of HDF5 libs is being customized, then rules for the
# dependencies of the HDF5 libs may be 'incomplete', add additional
# dependencies to this variable so that external projects pick them up
#
#option (HDF5_EXTERNAL_LIB_PREFIX "Use prefix for custom library naming." "")
set (HDF5_EXTERNAL_LIB_PREFIX "" CACHE STRING "Use prefix for custom library naming.")
mark_as_advanced (HDF5_EXTERNAL_LIB_PREFIX)
# HDF5_EXTERNAL_LIB_PREFIX :
# If the parent project needs to install hdf libraries, but avoid
# name conflicts with system versions, then a prefix may be added
# to ensure that the correct versions configured are used.
set (HDF5_LIB_INFIX "" CACHE STRING "Use infix for custom library naming.")
mark_as_advanced (HDF5_LIB_INFIX)
# HDF5_LIB_INFIX :
# This infix is added to all library names after 'hdf5'.
# e.g. the infix '_openmpi' results in the library name 'libhdf5_openmpi.so'
# This name is used in packages on debian based systems.
# (see https://packages.debian.org/jessie/amd64/libhdf5-openmpi-8/filelist)
#
# HDF5_INSTALL_BIN_DIR, HDF5_INSTALL_LIB_DIR, HDF5_INSTALL_INCLUDE_DIR, HDF5_INSTALL_DATA_DIR :
# Customize the 'bin', 'lib', 'include', and 'share' installation directories.
#
# HDF5_INSTALL_NO_DEVELOPMENT :
# Set to true to skip installation of headers and CMake package files.
#
# Consider this example from the ParaView project, it builds its own zlib
# library and tells HDF5 to add it as a dependency - this ensures that
# any project making use of this build of HDF5 will use the correct zlib
#
# # Tell hdf5 that we are manually overriding certain settings
# set (HDF5_EXTERNALLY_CONFIGURED 1)
# # Avoid duplicating names of installed libraries
# set (HDF5_EXTERNAL_LIB_PREFIX "vtk")
# # Export configuration to this export variable
# set (HDF5_EXPORTED_TARGETS "paraview-targets")
#
# # Setup all necessary overrides for zlib so that HDF5 uses our
# # internally compiled zlib rather than any other version
# if (HDF5_ENABLE_Z_LIB_SUPPORT)
# # We must tell the main HDF5 library that it depends on our zlib
# set (HDF5_LIB_DEPENDENCIES vtkzlib)
# # Override the zlib header file
# if (VTK_USE_SYSTEM_ZLIB)
# set (H5_ZLIB_HEADER "zlib.h")
# else ()
# set (H5_ZLIB_HEADER "vtk_zlib.h")
# # Set vars that FindZlib would have set if used in sub project
# set (ZLIB_INCLUDE_DIRS "${VTK_ZLIB_INCLUDE_DIRS}")
# set (ZLIB_LIBRARIES vtkzlib)
# endif ()
# endif ()
#
# # Add the sub project
# add_subdirectory (Utilities/hdf5-1.8)
#-----------------------------------------------------------------------------
string (TIMESTAMP CONFIG_DATE "%Y-%m-%d")
#-----------------------------------------------------------------------------
# Allow Visual Studio solution directories
#-----------------------------------------------------------------------------
# Provide a way for Visual Studio Express users to turn OFF the new FOLDER
# organization feature. Default to ON for non-Express users. Express users must
# explicitly turn off this option to build HDF5 in the Express IDE...
#
option (HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON)
mark_as_advanced (HDF5_USE_FOLDERS)
if (HDF5_USE_FOLDERS)
set_property (GLOBAL PROPERTY USE_FOLDERS ON)
endif ()
option (HDF5_NO_PACKAGES "CPACK - Disable packaging" OFF)
mark_as_advanced (HDF5_NO_PACKAGES)
option (ALLOW_UNSUPPORTED "Allow unsupported combinations of configure options" OFF)
mark_as_advanced (ALLOW_UNSUPPORTED)
#-----------------------------------------------------------------------------
# Set the core names of all the libraries
#-----------------------------------------------------------------------------
set (HDF5_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}")
set (HDF5_TEST_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_test")
set (HDF5_CPP_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_cpp")
set (HDF5_HL_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_hl")
set (HDF5_HL_CPP_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_hl_cpp")
set (HDF5_TOOLS_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_tools")
set (HDF5_UTILS_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_utils")
set (HDF5_F90_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_fortran")
set (HDF5_F90_C_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_f90cstub")
set (HDF5_F90_TEST_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_test_fortran")
set (HDF5_F90_C_TEST_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_test_f90cstub")
set (HDF5_HL_F90_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_hl_fortran")
set (HDF5_HL_F90_C_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_hl_f90cstub")
set (HDF5_JAVA_JNI_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_java")
set (HDF5_JAVA_HDF5_LIB_CORENAME "jarhdf5")
set (HDF5_JAVA_TEST_LIB_CORENAME "jartest5")
#-----------------------------------------------------------------------------
# Set the true names of all the libraries if customized by external project
#-----------------------------------------------------------------------------
set (HDF5_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_LIB_CORENAME}")
set (HDF5_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_LIB_CORENAME}")
set (HDF5_CPP_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_CPP_LIB_CORENAME}")
set (HDF5_HL_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_LIB_CORENAME}")
set (HDF5_HL_CPP_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_CPP_LIB_CORENAME}")
set (HDF5_TOOLS_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOLS_LIB_CORENAME}")
set (HDF5_UTILS_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_UTILS_LIB_CORENAME}")
set (HDF5_F90_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_LIB_CORENAME}")
set (HDF5_F90_C_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_C_LIB_CORENAME}")
set (HDF5_F90_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_TEST_LIB_CORENAME}")
set (HDF5_F90_C_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_C_TEST_LIB_CORENAME}")
set (HDF5_HL_F90_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_F90_LIB_CORENAME}")
set (HDF5_HL_F90_C_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_F90_C_LIB_CORENAME}")
set (HDF5_JAVA_JNI_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_JAVA_JNI_LIB_CORENAME}")
set (HDF5_JAVA_HDF5_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_JAVA_HDF5_LIB_CORENAME}")
set (HDF5_JAVA_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_JAVA_TEST_LIB_CORENAME}")
#-----------------------------------------------------------------------------
# Set the target names of all the libraries
#-----------------------------------------------------------------------------
set (HDF5_LIB_TARGET "${HDF5_LIB_CORENAME}-static")
set (HDF5_TEST_LIB_TARGET "${HDF5_TEST_LIB_CORENAME}-static")
set (HDF5_CPP_LIB_TARGET "${HDF5_CPP_LIB_CORENAME}-static")
set (HDF5_HL_LIB_TARGET "${HDF5_HL_LIB_CORENAME}-static")
set (HDF5_HL_CPP_LIB_TARGET "${HDF5_HL_CPP_LIB_CORENAME}-static")
set (HDF5_TOOLS_LIB_TARGET "${HDF5_TOOLS_LIB_CORENAME}-static")
set (HDF5_UTILS_LIB_TARGET "${HDF5_UTILS_LIB_CORENAME}-static")
set (HDF5_F90_LIB_TARGET "${HDF5_F90_LIB_CORENAME}-static")
set (HDF5_F90_C_LIB_TARGET "${HDF5_F90_C_LIB_CORENAME}-static")
set (HDF5_F90_TEST_LIB_TARGET "${HDF5_F90_TEST_LIB_CORENAME}-static")
set (HDF5_F90_C_TEST_LIB_TARGET "${HDF5_F90_C_TEST_LIB_CORENAME}-static")
set (HDF5_HL_F90_LIB_TARGET "${HDF5_HL_F90_LIB_CORENAME}-static")
set (HDF5_HL_F90_C_LIB_TARGET "${HDF5_HL_F90_C_LIB_CORENAME}-static")
set (HDF5_JAVA_JNI_LIB_TARGET "${HDF5_JAVA_JNI_LIB_CORENAME}")
set (HDF5_JAVA_HDF5_LIB_TARGET "${HDF5_JAVA_HDF5_LIB_CORENAME}")
set (HDF5_JAVA_TEST_LIB_TARGET "${HDF5_JAVA_TEST_LIB_CORENAME}")
set (HDF5_LIBSH_TARGET "${HDF5_LIB_CORENAME}-shared")
set (HDF5_TEST_LIBSH_TARGET "${HDF5_TEST_LIB_CORENAME}-shared")
set (HDF5_CPP_LIBSH_TARGET "${HDF5_CPP_LIB_CORENAME}-shared")
set (HDF5_HL_LIBSH_TARGET "${HDF5_HL_LIB_CORENAME}-shared")
set (HDF5_HL_CPP_LIBSH_TARGET "${HDF5_HL_CPP_LIB_CORENAME}-shared")
set (HDF5_TOOLS_LIBSH_TARGET "${HDF5_TOOLS_LIB_CORENAME}-shared")
set (HDF5_UTILS_LIBSH_TARGET "${HDF5_UTILS_LIB_CORENAME}-shared")
set (HDF5_F90_LIBSH_TARGET "${HDF5_F90_LIB_CORENAME}-shared")
set (HDF5_F90_C_LIBSH_TARGET "${HDF5_F90_C_LIB_CORENAME}-shared")
set (HDF5_F90_TEST_LIBSH_TARGET "${HDF5_F90_TEST_LIB_CORENAME}-shared")
set (HDF5_F90_C_TEST_LIBSH_TARGET "${HDF5_F90_C_TEST_LIB_CORENAME}-shared")
set (HDF5_HL_F90_LIBSH_TARGET "${HDF5_HL_F90_LIB_CORENAME}-shared")
set (HDF5_HL_F90_C_LIBSH_TARGET "${HDF5_HL_F90_C_LIB_CORENAME}-shared")
#-----------------------------------------------------------------------------
# Define some CMake variables for use later in the project
#-----------------------------------------------------------------------------
set (HDF_CONFIG_DIR ${HDF5_SOURCE_DIR}/config)
set (HDF_RESOURCES_DIR ${HDF5_SOURCE_DIR}/config/cmake)
set (HDF5_SRC_DIR ${HDF5_SOURCE_DIR}/src)
set (HDF5_TEST_SRC_DIR ${HDF5_SOURCE_DIR}/test)
set (HDF5_TEST_PAR_DIR ${HDF5_SOURCE_DIR}/testpar)
set (HDF5_TEST_API_SRC_DIR ${HDF5_SOURCE_DIR}/test/API)
set (HDF5_TEST_API_PAR_SRC_DIR ${HDF5_SOURCE_DIR}/testpar/API)
set (HDF5_CPP_SRC_DIR ${HDF5_SOURCE_DIR}/c++)
set (HDF5_CPP_TST_DIR ${HDF5_SOURCE_DIR}/c++/test)
set (HDF5_HL_SRC_DIR ${HDF5_SOURCE_DIR}/hl)
set (HDF5_HL_CPP_SRC_DIR ${HDF5_SOURCE_DIR}/hl/c++)
set (HDF5_HL_TOOLS_DIR ${HDF5_SOURCE_DIR}/hl/tools)
set (HDF5_TOOLS_DIR ${HDF5_SOURCE_DIR}/tools)
set (HDF5_TOOLS_SRC_DIR ${HDF5_SOURCE_DIR}/tools/src)
set (HDF5_TOOLS_TST_DIR ${HDF5_SOURCE_DIR}/tools/test)
set (HDF5_PERFORM_SRC_DIR ${HDF5_SOURCE_DIR}/tools/src/perform)
set (HDF5_UTILS_DIR ${HDF5_SOURCE_DIR}/utils)
set (HDF5_F90_SRC_DIR ${HDF5_SOURCE_DIR}/fortran)
set (HDF5_JAVA_JNI_SRC_DIR ${HDF5_SOURCE_DIR}/java/src/jni)
set (HDF5_JAVA_HDF5_SRC_DIR ${HDF5_SOURCE_DIR}/java/src/hdf)
set (HDF5_JAVA_TEST_SRC_DIR ${HDF5_SOURCE_DIR}/java/test)
set (HDF5_JAVA_LIB_DIR ${HDF5_SOURCE_DIR}/java/lib)
set (HDF5_JAVA_LOGGING_JAR ${HDF5_SOURCE_DIR}/java/lib/slf4j-api-2.0.6.jar)
set (HDF5_JAVA_LOGGING_NOP_JAR ${HDF5_SOURCE_DIR}/java/lib/ext/slf4j-nop-2.0.6.jar)
set (HDF5_JAVA_LOGGING_SIMPLE_JAR ${HDF5_SOURCE_DIR}/java/lib/ext/slf4j-simple-2.0.6.jar)
set (HDF5_DOXYGEN_DIR ${HDF5_SOURCE_DIR}/doxygen)
set (HDF5_SRC_INCLUDE_DIRS ${HDF5_SRC_DIR})
#-----------------------------------------------------------------------------
# parse the full version number from H5public.h and include in H5_VERS_INFO
#-----------------------------------------------------------------------------
file (READ ${HDF5_SRC_DIR}/H5public.h _h5public_h_contents)
string (REGEX REPLACE ".*#define[ \t]+H5_VERS_MAJOR[ \t]+([0-9]*).*$"
"\\1" H5_VERS_MAJOR ${_h5public_h_contents})
string (REGEX REPLACE ".*#define[ \t]+H5_VERS_MINOR[ \t]+([0-9]*).*$"
"\\1" H5_VERS_MINOR ${_h5public_h_contents})
string (REGEX REPLACE ".*#define[ \t]+H5_VERS_RELEASE[ \t]+([0-9]*).*$"
"\\1" H5_VERS_RELEASE ${_h5public_h_contents})
string (REGEX REPLACE ".*#define[ \t]+H5_VERS_SUBRELEASE[ \t]+\"([0-9A-Za-z._-]*)\".*$"
"\\1" H5_VERS_SUBRELEASE ${_h5public_h_contents})
message (TRACE "VERSION: ${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}-${H5_VERS_SUBRELEASE}")
#-----------------------------------------------------------------------------
# parse the full soversion number from config/lt_vers.am and include in H5_SOVERS_INFO
#-----------------------------------------------------------------------------
file (READ ${HDF5_SOURCE_DIR}/config/lt_vers.am _lt_vers_am_contents)
string (REGEX REPLACE ".*LT_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$"
"\\1" H5_LIB_SOVERS_INTERFACE ${_lt_vers_am_contents})
string (REGEX REPLACE ".*LT_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$"
"\\1" H5_LIB_SOVERS_MINOR ${_lt_vers_am_contents})
string (REGEX REPLACE ".*LT_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$"
"\\1" H5_LIB_SOVERS_RELEASE ${_lt_vers_am_contents})
math (EXPR H5_LIB_SOVERS_MAJOR ${H5_LIB_SOVERS_INTERFACE}-${H5_LIB_SOVERS_RELEASE})
message (VERBOSE "SOVERSION: ${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}")
string (REGEX MATCH ".*LT_TOOLS_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_TOOLS_SOVERS_EXISTS ${_lt_vers_am_contents})
if (H5_TOOLS_SOVERS_EXISTS)
string (REGEX REPLACE ".*LT_TOOLS_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$"
"\\1" H5_TOOLS_SOVERS_INTERFACE ${_lt_vers_am_contents})
string (REGEX REPLACE ".*LT_TOOLS_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$"
"\\1" H5_TOOLS_SOVERS_MINOR ${_lt_vers_am_contents})
string (REGEX REPLACE ".*LT_TOOLS_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$"
"\\1" H5_TOOLS_SOVERS_RELEASE ${_lt_vers_am_contents})
math (EXPR H5_TOOLS_SOVERS_MAJOR ${H5_TOOLS_SOVERS_INTERFACE}-${H5_TOOLS_SOVERS_RELEASE})
message (VERBOSE "SOVERSION_TOOLS: ${H5_TOOLS_SOVERS_MAJOR}.${H5_TOOLS_SOVERS_RELEASE}.${H5_TOOLS_SOVERS_MINOR}")
endif ()
string (REGEX MATCH ".*LT_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_CXX_SOVERS_EXISTS ${_lt_vers_am_contents})
if (H5_CXX_SOVERS_EXISTS)
string (REGEX REPLACE ".*LT_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$"
"\\1" H5_CXX_SOVERS_INTERFACE ${_lt_vers_am_contents})
string (REGEX REPLACE ".*LT_CXX_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$"
"\\1" H5_CXX_SOVERS_MINOR ${_lt_vers_am_contents})
string (REGEX REPLACE ".*LT_CXX_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$"
"\\1" H5_CXX_SOVERS_RELEASE ${_lt_vers_am_contents})
math (EXPR H5_CXX_SOVERS_MAJOR ${H5_CXX_SOVERS_INTERFACE}-${H5_CXX_SOVERS_RELEASE})
message (VERBOSE "SOVERSION_CXX: ${H5_CXX_SOVERS_MAJOR}.${H5_CXX_SOVERS_RELEASE}.${H5_CXX_SOVERS_MINOR}")
endif ()
string (REGEX MATCH ".*LT_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_F_SOVERS_EXISTS ${_lt_vers_am_contents})
if (H5_F_SOVERS_EXISTS)
string (REGEX REPLACE ".*LT_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$"
"\\1" H5_F_SOVERS_INTERFACE ${_lt_vers_am_contents})
string (REGEX REPLACE ".*LT_F_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$"
"\\1" H5_F_SOVERS_MINOR ${_lt_vers_am_contents})
string (REGEX REPLACE ".*LT_F_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$"
"\\1" H5_F_SOVERS_RELEASE ${_lt_vers_am_contents})
math (EXPR H5_F_SOVERS_MAJOR ${H5_F_SOVERS_INTERFACE}-${H5_F_SOVERS_RELEASE})
message (VERBOSE "SOVERSION_F: ${H5_F_SOVERS_MAJOR}.${H5_F_SOVERS_RELEASE}.${H5_F_SOVERS_MINOR}")
endif ()
string (REGEX MATCH ".*LT_HL_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_HL_SOVERS_EXISTS ${_lt_vers_am_contents})
if (H5_HL_SOVERS_EXISTS)
string (REGEX REPLACE ".*LT_HL_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$"
"\\1" H5_HL_SOVERS_INTERFACE ${_lt_vers_am_contents})
string (REGEX REPLACE ".*LT_HL_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$"
"\\1" H5_HL_SOVERS_MINOR ${_lt_vers_am_contents})
string (REGEX REPLACE ".*LT_HL_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$"
"\\1" H5_HL_SOVERS_RELEASE ${_lt_vers_am_contents})
math (EXPR H5_HL_SOVERS_MAJOR ${H5_HL_SOVERS_INTERFACE}-${H5_HL_SOVERS_RELEASE})
message (VERBOSE "SOVERSION_HL: ${H5_HL_SOVERS_MAJOR}.${H5_HL_SOVERS_RELEASE}.${H5_HL_SOVERS_MINOR}")
endif ()
string (REGEX MATCH ".*LT_HL_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_HL_CXX_SOVERS_EXISTS ${_lt_vers_am_contents})
if (H5_HL_CXX_SOVERS_EXISTS)
string (REGEX REPLACE ".*LT_HL_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$"
"\\1" H5_HL_CXX_SOVERS_INTERFACE ${_lt_vers_am_contents})
string (REGEX REPLACE ".*LT_HL_CXX_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$"
"\\1" H5_HL_CXX_SOVERS_MINOR ${_lt_vers_am_contents})
string (REGEX REPLACE ".*LT_HL_CXX_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$"
"\\1" H5_HL_CXX_SOVERS_RELEASE ${_lt_vers_am_contents})
math (EXPR H5_HL_CXX_SOVERS_MAJOR ${H5_HL_CXX_SOVERS_INTERFACE}-${H5_HL_CXX_SOVERS_RELEASE})
message (VERBOSE "SOVERSION_HL_CXX: ${H5_HL_CXX_SOVERS_MAJOR}.${H5_HL_CXX_SOVERS_RELEASE}.${H5_HL_CXX_SOVERS_MINOR}")
endif ()
string (REGEX MATCH ".*LT_HL_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_HL_F_SOVERS_EXISTS ${_lt_vers_am_contents})
if (H5_HL_F_SOVERS_EXISTS)
string (REGEX REPLACE ".*LT_HL_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$"
"\\1" H5_HL_F_SOVERS_INTERFACE ${_lt_vers_am_contents})
string (REGEX REPLACE ".*LT_HL_F_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$"
"\\1" H5_HL_F_SOVERS_MINOR ${_lt_vers_am_contents})
string (REGEX REPLACE ".*LT_HL_F_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$"
"\\1" H5_HL_F_SOVERS_RELEASE ${_lt_vers_am_contents})
math (EXPR H5_HL_F_SOVERS_MAJOR ${H5_HL_F_SOVERS_INTERFACE}-${H5_HL_F_SOVERS_RELEASE})
message (VERBOSE "SOVERSION_HL_F: ${H5_HL_F_SOVERS_MAJOR}.${H5_HL_F_SOVERS_RELEASE}.${H5_HL_F_SOVERS_MINOR}")
endif ()
string (REGEX MATCH ".*LT_JAVA_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_JAVA_SOVERS_EXISTS ${_lt_vers_am_contents})
if(H5_JAVA_SOVERS_EXISTS)
string (REGEX REPLACE ".*LT_JAVA_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$"
"\\1" H5_JAVA_SOVERS_INTERFACE ${_lt_vers_am_contents})
string (REGEX REPLACE ".*LT_JAVA_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$"
"\\1" H5_JAVA_SOVERS_MINOR ${_lt_vers_am_contents})
string (REGEX REPLACE ".*LT_JAVA_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$"
"\\1" H5_JAVA_SOVERS_RELEASE ${_lt_vers_am_contents})
math (EXPR H5_JAVA_SOVERS_MAJOR ${H5_JAVA_SOVERS_INTERFACE}-${H5_JAVA_SOVERS_RELEASE})
message (VERBOSE "SOVERSION_JAVA: ${H5_JAVA_SOVERS_MAJOR}.${H5_JAVA_SOVERS_RELEASE}.${H5_JAVA_SOVERS_MINOR}")
endif ()
#-----------------------------------------------------------------------------
# Basic HDF5 stuff here
#-----------------------------------------------------------------------------
set (HDF5_PACKAGE "hdf5")
set (HDF5_PACKAGE_NAME "HDF5")
set (HDF5_PACKAGE_VERSION "${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}")
set (HDF5_PACKAGE_VERSION_MAJOR "${H5_VERS_MAJOR}.${H5_VERS_MINOR}")
set (HDF5_PACKAGE_VERSION_MINOR "${H5_VERS_RELEASE}")
if (H5_VERS_SUBRELEASE)
set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}.${H5_VERS_SUBRELEASE}")
set (HDF5_RELEASE_VERSION_STRING "${HDF5_PACKAGE_VERSION}-${H5_VERS_SUBRELEASE}")
else ()
set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}")
set (HDF5_RELEASE_VERSION_STRING "${HDF5_PACKAGE_VERSION}")
endif ()
set (HDF5_LIB_PACKAGE_SOVERSION "${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}")
set (HDF5_LIB_PACKAGE_SOVERSION_MAJOR "${H5_LIB_SOVERS_MAJOR}")
if (H5_TOOLS_SOVERS_EXISTS)
set (HDF5_TOOLS_PACKAGE_SOVERSION "${H5_TOOLS_SOVERS_MAJOR}.${H5_TOOLS_SOVERS_RELEASE}.${H5_TOOLS_SOVERS_MINOR}")
set (HDF5_TOOLS_PACKAGE_SOVERSION_MAJOR "${H5_TOOLS_SOVERS_MAJOR}")
else ()
set (HDF5_TOOLS_PACKAGE_SOVERSION "${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}")
set (HDF5_TOOLS_PACKAGE_SOVERSION_MAJOR "${H5_LIB_SOVERS_MAJOR}")
endif ()
if (H5_CXX_SOVERS_EXISTS)
set (HDF5_CXX_PACKAGE_SOVERSION "${H5_CXX_SOVERS_MAJOR}.${H5_CXX_SOVERS_RELEASE}.${H5_CXX_SOVERS_MINOR}")
set (HDF5_CXX_PACKAGE_SOVERSION_MAJOR "${H5_CXX_SOVERS_MAJOR}")
else ()
set (HDF5_CXX_PACKAGE_SOVERSION "${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}")
set (HDF5_CXX_PACKAGE_SOVERSION_MAJOR "${H5_LIB_SOVERS_MAJOR}")
endif ()
if (H5_F_SOVERS_EXISTS)
set (HDF5_F_PACKAGE_SOVERSION "${H5_F_SOVERS_MAJOR}.${H5_F_SOVERS_RELEASE}.${H5_F_SOVERS_MINOR}")
set (HDF5_F_PACKAGE_SOVERSION_MAJOR "${H5_F_SOVERS_MAJOR}")
else ()
set (HDF5_F_PACKAGE_SOVERSION "${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}")
set (HDF5_F_PACKAGE_SOVERSION_MAJOR "${H5_LIB_SOVERS_MAJOR}")
endif ()
if (H5_HL_SOVERS_EXISTS)
set (HDF5_HL_PACKAGE_SOVERSION "${H5_HL_SOVERS_MAJOR}.${H5_HL_SOVERS_RELEASE}.${H5_HL_SOVERS_MINOR}")
set (HDF5_HL_PACKAGE_SOVERSION_MAJOR "${H5_HL_SOVERS_MAJOR}")
else ()
set (HDF5_HL_PACKAGE_SOVERSION "${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}")
set (HDF5_HL_PACKAGE_SOVERSION_MAJOR "${H5_LIB_SOVERS_MAJOR}")
endif ()
if (H5_HL_F_SOVERS_EXISTS)
set (HDF5_HL_CXX_PACKAGE_SOVERSION "${H5_HL_CXX_SOVERS_MAJOR}.${H5_HL_CXX_SOVERS_RELEASE}.${H5_HL_CXX_SOVERS_MINOR}")
set (HDF5_HL_CXX_PACKAGE_SOVERSION_MAJOR "${H5_HL_CXX_SOVERS_MAJOR}")
else ()
set (HDF5_HL_CXX_PACKAGE_SOVERSION "${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}")
set (HDF5_HL_CXX_PACKAGE_SOVERSION_MAJOR "${H5_LIB_SOVERS_MAJOR}")
endif ()
if (H5_HL_F_SOVERS_EXISTS)
set (HDF5_HL_F_PACKAGE_SOVERSION "${H5_HL_F_SOVERS_MAJOR}.${H5_HL_F_SOVERS_RELEASE}.${H5_HL_F_SOVERS_MINOR}")
set (HDF5_HL_F_PACKAGE_SOVERSION_MAJOR "${H5_HL_F_SOVERS_MAJOR}")
else ()
set (HDF5_HL_F_PACKAGE_SOVERSION "${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}")
set (HDF5_HL_F_PACKAGE_SOVERSION_MAJOR "${H5_LIB_SOVERS_MAJOR}")
endif ()
if (H5_JAVA_SOVERS_EXISTS)
set (HDF5_JAVA_PACKAGE_SOVERSION "${H5_JAVA_SOVERS_MAJOR}.${H5_JAVA_SOVERS_RELEASE}.${H5_JAVA_SOVERS_MINOR}")
set (HDF5_JAVA_PACKAGE_SOVERSION_MAJOR "${H5_JAVA_SOVERS_MAJOR}")
else ()
set (HDF5_JAVA_PACKAGE_SOVERSION "${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}")
set (HDF5_JAVA_PACKAGE_SOVERSION_MAJOR "${H5_LIB_SOVERS_MAJOR}")
endif ()
set (HDF5_PACKAGE_STRING "${HDF5_PACKAGE_NAME} ${HDF5_PACKAGE_VERSION_STRING}")
set (HDF5_PACKAGE_TARNAME "${HDF5_PACKAGE}${HDF_PACKAGE_EXT}")
set (HDF5_PACKAGE_URL "http://www.hdfgroup.org")
set (HDF5_PACKAGE_BUGREPORT "help@hdfgroup.org")
#-----------------------------------------------------------------------------
# Include some macros for reusable code
#-----------------------------------------------------------------------------
include (${HDF_RESOURCES_DIR}/HDFMacros.cmake)
HDF_DIR_PATHS(${HDF5_PACKAGE_NAME})
include (${HDF_RESOURCES_DIR}/HDFLibMacros.cmake)
include (${HDF_RESOURCES_DIR}/HDF5PluginMacros.cmake)
include (${HDF_RESOURCES_DIR}/HDF5Macros.cmake)
#-----------------------------------------------------------------------------
# Targets built within this project are exported at Install time for use
# by other projects.
#-----------------------------------------------------------------------------
if (NOT HDF5_EXPORTED_TARGETS)
set (HDF5_EXPORTED_TARGETS "hdf5-targets")
endif ()
#-----------------------------------------------------------------------------
# To include a library in the list exported by the project AT BUILD TIME,
# add it to this variable. This is NOT used by Make Install, but for projects
# which include hdf5 as a sub-project within their build tree
#-----------------------------------------------------------------------------
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "")
set_global_variable (HDF5_UTILS_TO_EXPORT "")
set (EXTERNAL_HEADER_LIST "")
set (EXTERNAL_LIBRARY_LIST "")
set (EXTERNAL_LIBRARYDLL_LIST "")
#-----------------------------------------------------------------------------
# Run all the CMake configuration tests for our build environment
#-----------------------------------------------------------------------------
include (${HDF_RESOURCES_DIR}/ConfigureChecks.cmake)
set (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
#-----------------------------------------------------------------------------
# Include directories in the source or build tree should come before other
# directories to prioritize headers in the sources over installed ones.
#-----------------------------------------------------------------------------
set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)
#-----------------------------------------------------------------------------
# Mac OS X Options
#-----------------------------------------------------------------------------
if (HDF5_BUILD_FRAMEWORKS AND NOT BUILD_SHARED_LIBS)
set (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries" FORCE)
endif ()
#-----------------------------------------------------------------------------
# Option to Build Shared and Static libs, default is both
#-----------------------------------------------------------------------------
option (ONLY_SHARED_LIBS "Only Build Shared Libraries" OFF)
mark_as_advanced (ONLY_SHARED_LIBS)
option (BUILD_STATIC_LIBS "Build Static Libraries" ON)
set (H5_ENABLE_STATIC_LIB NO)
option (BUILD_SHARED_LIBS "Build Shared Libraries" ON)
set (H5_ENABLE_SHARED_LIB NO)
# only shared libraries is true if user forces static OFF
if (NOT BUILD_STATIC_LIBS)
set (ONLY_SHARED_LIBS ON CACHE BOOL "Only Build Shared Libraries" FORCE)
endif ()
# only shared libraries is set ON by user then force settings
if (ONLY_SHARED_LIBS)
set (H5_ENABLE_STATIC_LIB NO)
set (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries" FORCE)
set (BUILD_STATIC_LIBS OFF CACHE BOOL "Build Static Libraries" FORCE)
endif ()
if (BUILD_STATIC_LIBS)
set (H5_ENABLE_STATIC_LIB YES)
endif ()
if (BUILD_SHARED_LIBS)
set (H5_ENABLE_SHARED_LIB YES)
endif ()
set (CMAKE_POSITION_INDEPENDENT_CODE ON)
if (NOT BUILD_SHARED_LIBS)
set (tgt_file_ext "")
else ()
set (tgt_file_ext "-shared")
endif ()
#-----------------------------------------------------------------------------
# perl is used in some optional src and tests, check availability
find_package (Perl)
if (PERL_FOUND)
set (H5_PERL_FOUND YES)
endif ()
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Option to Build Static executables
#-----------------------------------------------------------------------------
option (BUILD_STATIC_EXECS "Build Static Executables" OFF)
if (BUILD_STATIC_EXECS)
if (NOT WIN32)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static")
endif ()
endif ()
option (HDF5_ENABLE_ANALYZER_TOOLS "enable the use of Clang tools" OFF)
mark_as_advanced (HDF5_ENABLE_ANALYZER_TOOLS)
if (HDF5_ENABLE_ANALYZER_TOOLS)
include (${HDF5_SOURCE_DIR}/config/sanitizer/tools.cmake)
endif ()
option (HDF5_ENABLE_SANITIZERS "execute the Clang sanitizer" OFF)
mark_as_advanced (HDF5_ENABLE_SANITIZERS)
if (HDF5_ENABLE_SANITIZERS)
include (${HDF5_SOURCE_DIR}/config/sanitizer/sanitizers.cmake)
endif ()
option (HDF5_ENABLE_FORMATTERS "format source files" OFF)
mark_as_advanced (HDF5_ENABLE_FORMATTERS)
if (HDF5_ENABLE_FORMATTERS)
include (${HDF5_SOURCE_DIR}/config/sanitizer/formatting.cmake)
endif ()
#-----------------------------------------------------------------------------
# Option to use code coverage
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" OFF)
if (HDF5_ENABLE_COVERAGE)
include (${HDF5_SOURCE_DIR}/config/sanitizer/code-coverage.cmake)
if(CODE_COVERAGE AND CODE_COVERAGE_ADDED)
add_code_coverage () # Adds instrumentation to all targets
else ()
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 --coverage -fprofile-arcs -ftest-coverage")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g --coverage -O0 -fprofile-arcs -ftest-coverage")
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
set (LDFLAGS "${LDFLAGS} -fprofile-arcs -ftest-coverage")
link_libraries (gcov)
else ()
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
endif ()
endif ()
endif ()
#-----------------------------------------------------------------------------
# Option to indicate using a memory checker
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF)
if (HDF5_ENABLE_USING_MEMCHECKER)
set (H5_USING_MEMCHECKER 1)
endif ()
#-----------------------------------------------------------------------------
# Option to enable/disable using pread/pwrite for VFDs
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_PREADWRITE "Use pread/pwrite in sec2/log/core VFDs in place of read/write (when available)" ON)
mark_as_advanced (HDF5_ENABLE_PREADWRITE)
if (HDF5_ENABLE_PREADWRITE AND H5_HAVE_PREAD AND H5_HAVE_PWRITE)
set (H5_HAVE_PREADWRITE 1)
endif ()
#-----------------------------------------------------------------------------
# Option to use deprecated public API symbols
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_DEPRECATED_SYMBOLS "Enable deprecated public API symbols" ON)
if (HDF5_ENABLE_DEPRECATED_SYMBOLS)
set (H5_NO_DEPRECATED_SYMBOLS 0)
else ()
set (H5_NO_DEPRECATED_SYMBOLS 1)
endif ()
#-----------------------------------------------------------------------------
# When building utility executables that generate other (source) files :
# we make use of the following variables defined in the root CMakeLists.
# Certain systems may add /Debug or /Release to output paths
# and we need to call the executable from inside the CMake configuration
#-----------------------------------------------------------------------------
if (WIN32)
add_compile_definitions (_CRT_SECURE_NO_WARNINGS)
if (MSVC)
add_compile_definitions (_BIND_TO_CURRENT_VCLIBS_VERSION=1 _CONSOLE)
endif ()
endif ()
option (HDF5_MINGW_STATIC_GCC_LIBS "Statically link libgcc/libstdc++" OFF)
if (MSVC)
set (CMAKE_MFC_FLAG 0)
set (WIN_COMPILE_FLAGS "")
set (WIN_LINK_FLAGS "")
endif ()
# Do not generate test programs by default
option (HDF5_BUILD_GENERATORS "Build Test Generators" OFF)
#-----------------------------------------------------------------------------
# Add some definitions for Debug Builds
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_TRACE "Enable API tracing capability" OFF)
mark_as_advanced (HDF5_ENABLE_TRACE)
if (${HDF_CFG_NAME} MATCHES "Debug" OR ${HDF_CFG_NAME} MATCHES "Developer")
# Enable instrumenting of the library's internal operations
option (HDF5_ENABLE_INSTRUMENT "Instrument The library" OFF)
# Instrumenting is enabled by default for parallel debug builds
if (HDF5_ENABLE_PARALLEL)
set (HDF5_ENABLE_INSTRUMENT ON CACHE BOOL "Instrument The library" FORCE)
endif ()
if (HDF5_ENABLE_INSTRUMENT)
set (H5_HAVE_INSTRUMENTED_LIBRARY 1)
endif ()
mark_as_advanced (HDF5_ENABLE_INSTRUMENT)
endif ()
#-----------------------------------------------------------------------------
# Add some definitions for Developer Builds
#-----------------------------------------------------------------------------
if (${HDF_CFG_NAME} MATCHES "Developer")
include (${HDF_RESOURCES_DIR}/HDF5DeveloperBuild.cmake)
endif ()
#-----------------------------------------------------------------------------
# Option to embed library info into executables
#-----------------------------------------------------------------------------
if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
set (H5_HAVE_EMBEDDED_LIBINFO 0)
else ()
option (HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON)
if (HDF5_ENABLE_EMBEDDED_LIBINFO)
set (H5_HAVE_EMBEDDED_LIBINFO 1)
endif ()
endif ()
include (${HDF_RESOURCES_DIR}/HDFCompilerFlags.cmake)
set (CMAKE_MODULE_PATH ${HDF_RESOURCES_DIR} ${CMAKE_MODULE_PATH})
#-----------------------------------------------------------------------------
# Option to Enable HDFS
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_HDFS "Enable HDFS" OFF)
if (HDF5_ENABLE_HDFS)
find_package(JNI REQUIRED)
if (JNI_FOUND)
set (H5_HAVE_LIBJVM 1)
endif ()
find_package(HDFS REQUIRED)
if (HDFS_FOUND)
set (H5_HAVE_LIBHDFS 1)
set (H5_HAVE_HDFS_H 1)
if (NOT MSVC)
list (APPEND LINK_LIBS -pthread)
endif ()
else ()
message (FATAL_ERROR "Set to use libhdfs library, but could not find or use libhdfs. Please verify that the path to HADOOP_HOME is valid, and/or reconfigure without HDF5_ENABLE_HDFS")
endif ()
endif ()
#-----------------------------------------------------------------------------
# Option to Enable MPI Parallel
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF)
if (HDF5_ENABLE_PARALLEL)
find_package(MPI REQUIRED)
if (MPI_C_FOUND)
set (H5_HAVE_PARALLEL 1)
# MPI checks, only do these if MPI_C_FOUND is true, otherwise they always fail
# and once set, they are cached as false and not regenerated
set (CMAKE_REQUIRED_LIBRARIES "${MPI_C_LIBRARIES}")
set (CMAKE_REQUIRED_INCLUDES "${MPI_C_INCLUDE_DIRS}")
# Used by Fortran + MPI
CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm)
CHECK_SYMBOL_EXISTS (MPI_Info_c2f "mpi.h" H5_HAVE_MPI_MULTI_LANG_Info)
# Used by Parallel Compression feature
set (PARALLEL_FILTERED_WRITES ON)
CHECK_SYMBOL_EXISTS (MPI_Ibarrier "mpi.h" H5_HAVE_MPI_Ibarrier)
CHECK_SYMBOL_EXISTS (MPI_Issend "mpi.h" H5_HAVE_MPI_Issend)
CHECK_SYMBOL_EXISTS (MPI_Iprobe "mpi.h" H5_HAVE_MPI_Iprobe)
CHECK_SYMBOL_EXISTS (MPI_Irecv "mpi.h" H5_HAVE_MPI_Irecv)
if (H5_HAVE_MPI_Ibarrier AND H5_HAVE_MPI_Issend AND H5_HAVE_MPI_Iprobe AND H5_HAVE_MPI_Irecv)
set (H5_HAVE_PARALLEL_FILTERED_WRITES 1)
else ()
message (WARNING "The MPI_Ibarrier/MPI_Issend/MPI_Iprobe/MPI_Irecv functions could not be located.
Parallel writes of filtered data will be disabled.")
set (PARALLEL_FILTERED_WRITES OFF)
endif ()
# Used by big I/O feature
set (LARGE_PARALLEL_IO ON)
CHECK_SYMBOL_EXISTS (MPI_Get_elements_x "mpi.h" H5_HAVE_MPI_Get_elements_x)
CHECK_SYMBOL_EXISTS (MPI_Type_size_x "mpi.h" H5_HAVE_MPI_Type_size_x)
if (NOT H5_HAVE_MPI_Get_elements_x OR NOT H5_HAVE_MPI_Type_size_x)
message (WARNING "The MPI_Get_elements_x and/or MPI_Type_size_x functions could not be located.
Reading/Writing >2GB of data in a single parallel I/O operation will be disabled.")
set (LARGE_PARALLEL_IO OFF)
endif ()
else ()
message (FATAL_ERROR "Parallel libraries not found")
endif ()
endif ()
# Parallel IO usage requires MPI to be Linked and Included
if (H5_HAVE_PARALLEL)
set (LINK_LIBS ${LINK_LIBS} ${MPI_C_LIBRARIES})
if (MPI_C_LINK_FLAGS)
set (CMAKE_EXE_LINKER_FLAGS "${MPI_C_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}")
endif ()
endif ()
# Determine whether to build the HDF5 Subfiling VFD
set (H5FD_SUBFILING_DIR ${HDF5_SRC_DIR}/H5FDsubfiling)
set (HDF5_SRC_INCLUDE_DIRS
${HDF5_SRC_INCLUDE_DIRS}
${H5FD_SUBFILING_DIR}
)
option (HDF5_ENABLE_SUBFILING_VFD "Build Parallel HDF5 Subfiling VFD" OFF)
if (HDF5_ENABLE_SUBFILING_VFD)
if (WIN32)
message (FATAL_ERROR " **** Subfiling is not supported on Windows **** ")
endif ()
if (NOT HDF5_ENABLE_PARALLEL)
message (FATAL_ERROR "Subfiling VFD requires a parallel HDF5 build")
else ()
# Check for MPI_Comm_split_type
CHECK_SYMBOL_EXISTS (MPI_Comm_split_type "mpi.h" H5_HAVE_MPI_Comm_split_type)
if (NOT H5_HAVE_MPI_Comm_split_type)
message (FATAL_ERROR "Subfiling VFD requires MPI-3 support for MPI_Comm_split_type")
endif ()
endif ()
if (NOT DEFINED Threads_FOUND)
set (THREADS_PREFER_PTHREAD_FLAG ON)
find_package (Threads REQUIRED)
endif ()
# For now, make sure we're using pthreads. Once Subfiling can be
# supported on Windows, we should allow Win32 threads as well
if (NOT ${Threads_FOUND} OR NOT ${CMAKE_USE_PTHREADS_INIT})
message (FATAL_ERROR "Subfiling requires pthreads for system thread library")
endif ()
CHECK_INCLUDE_FILE("stdatomic.h" HAVE_STDATOMIC_H)
if (NOT HAVE_STDATOMIC_H)
message (FATAL_ERROR "Subfiling VFD requires atomic operations support. C11 stdatomic.h NOT available.")
else()
set (H5_HAVE_STDATOMIC_H 1)
endif()
set (H5_HAVE_SUBFILING_VFD 1)
# IOC VFD is currently only built when subfiling is enabled
set (H5_HAVE_IOC_VFD 1)
message (STATUS "Setting up to use Mercury components")
set (H5FD_SUBFILING_MERCURY_DIR ${H5FD_SUBFILING_DIR}/mercury/src/util)
set (HDF5_SRC_INCLUDE_DIRS
${HDF5_SRC_INCLUDE_DIRS}
${H5FD_SUBFILING_MERCURY_DIR}
)
set (CMAKE_REQUIRED_INCLUDES "${H5FD_SUBFILING_MERCURY_DIR}")
# Run some configure checks for the Mercury util files
set (CMAKE_EXTRA_INCLUDE_FILES pthread.h)
set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
check_type_size(PTHREAD_MUTEX_ADAPTIVE_NP PTHREAD_MUTEX_ADAPTIVE_NP_SIZE)
if (HAVE_PTHREAD_MUTEX_ADAPTIVE_NP_SIZE)
set (${HDF_PREFIX}_HAVE_PTHREAD_MUTEX_ADAPTIVE_NP 1)
endif ()
check_symbol_exists(pthread_condattr_setclock pthread.h
${HDF_PREFIX}_HAVE_PTHREAD_CONDATTR_SETCLOCK)
unset (CMAKE_EXTRA_INCLUDE_FILES)
unset (CMAKE_REQUIRED_LIBRARIES)
endif()
#option (DEFAULT_API_VERSION "Enable v1.14 API (v16, v18, v110, v112, v114)" "v114")
set (DEFAULT_API_VERSION "v114" CACHE STRING "Enable v1.14 API (v16, v18, v110, v112, v114)")
set_property (CACHE DEFAULT_API_VERSION PROPERTY STRINGS v16 v18 v110 v112 v114)
#-----------------------------------------------------------------------------
# Option to use 1.6.x API
#-----------------------------------------------------------------------------
set (H5_USE_16_API_DEFAULT 0)
if (DEFAULT_API_VERSION MATCHES "v16")
set (H5_USE_16_API_DEFAULT 1)
endif ()
#-----------------------------------------------------------------------------
# Option to use 1.8.x API
#-----------------------------------------------------------------------------
set (H5_USE_18_API_DEFAULT 0)
if (DEFAULT_API_VERSION MATCHES "v18")
set (H5_USE_18_API_DEFAULT 1)
endif ()
#-----------------------------------------------------------------------------
# Option to use 1.10.x API
#-----------------------------------------------------------------------------
set (H5_USE_110_API_DEFAULT 0)
if (DEFAULT_API_VERSION MATCHES "v110")
set (H5_USE_110_API_DEFAULT 1)
endif ()
#-----------------------------------------------------------------------------
# Option to use 1.12.x API
#-----------------------------------------------------------------------------
set (H5_USE_112_API_DEFAULT 0)
if (DEFAULT_API_VERSION MATCHES "v112")
set (H5_USE_112_API_DEFAULT 1)
endif ()
#-----------------------------------------------------------------------------
# Option to use 1.14.x API
#-----------------------------------------------------------------------------
if (NOT DEFAULT_API_VERSION)
set (DEFAULT_API_VERSION "v114")
endif ()
set (H5_USE_114_API_DEFAULT 0)
if (DEFAULT_API_VERSION MATCHES "v114")
set (H5_USE_114_API_DEFAULT 1)
endif ()
#-----------------------------------------------------------------------------
# Include user macros
#-----------------------------------------------------------------------------
include (UserMacros.cmake)
#-----------------------------------------------------------------------------
# Include filter (zlib, szip, etc.) macros
#-----------------------------------------------------------------------------
include (CMakeFilters.cmake)
#-----------------------------------------------------------------------------
# Include external VOL connectors
#-----------------------------------------------------------------------------
include (CMakeVOL.cmake)
#-----------------------------------------------------------------------------
# Option for external libraries on windows
#-----------------------------------------------------------------------------
option (HDF5_PACKAGE_EXTLIBS "CPACK - include external libraries" OFF)
if (NOT HDF5_EXTERNALLY_CONFIGURED)
if (HDF5_PACKAGE_EXTLIBS)
set (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE)
endif ()
endif ()
#-----------------------------------------------------------------------------
# Option to use threadsafe
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_THREADSAFE "Enable thread-safety" OFF)
if (HDF5_ENABLE_THREADSAFE)
# check for unsupported options
if (WIN32)
if (BUILD_STATIC_LIBS)
message (FATAL_ERROR " **** thread-safety option not supported with static library **** ")
endif ()
endif ()
if (HDF5_BUILD_FORTRAN)
if (NOT ALLOW_UNSUPPORTED)
message (FATAL_ERROR " **** Fortran and thread-safety options are not supported, override with ALLOW_UNSUPPORTED option **** ")
else ()
message (VERBOSE " **** Allowing unsupported Fortran and thread-safety options **** ")
endif ()
endif ()
if (HDF5_BUILD_CPP_LIB)
if (NOT ALLOW_UNSUPPORTED)
message (FATAL_ERROR " **** C++ and thread-safety options are not supported, override with ALLOW_UNSUPPORTED option **** ")
else ()
message (VERBOSE " **** Allowing unsupported C++ and thread-safety options **** ")
endif ()
endif ()
if (HDF5_BUILD_HL_LIB)
if (NOT ALLOW_UNSUPPORTED)
message (FATAL_ERROR " **** HL and thread-safety options are not supported, override with ALLOW_UNSUPPORTED option **** ")
else ()
message (VERBOSE " **** Allowing unsupported HL and thread-safety options **** ")
endif ()
endif ()
if (H5_HAVE_IOEO)
message (VERBOSE " **** Win32 threads requires WINVER>=0x600 (Windows Vista/7/8) **** ")
set (H5_HAVE_WIN_THREADS 1)
else ()
if (NOT H5_HAVE_PTHREAD_H)
message (FATAL_ERROR " **** thread-safe option requires Win32 threads or Pthreads **** ")
endif ()
endif ()
set (THREADS_PREFER_PTHREAD_FLAG ON)
find_package (Threads REQUIRED)
if (Threads_FOUND)
set (H5_HAVE_THREADSAFE 1)
endif ()
endif ()
#-----------------------------------------------------------------------------
# Option to build the map API
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_MAP_API "Build the map API" OFF)
if (HDF5_ENABLE_MAP_API)
set (H5_HAVE_MAP_API 1)
endif ()
#-----------------------------------------------------------------------------
# Add the HDF5 Library Target to the build
#-----------------------------------------------------------------------------
add_subdirectory (src)
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
if ((ZLIB_FOUND AND ZLIB_USE_EXTERNAL) OR (SZIP_FOUND AND SZIP_USE_EXTERNAL))
if (BUILD_STATIC_LIBS)
add_dependencies (${HDF5_LIB_TARGET} ${LINK_COMP_LIBS})
endif ()
if (BUILD_SHARED_LIBS)
add_dependencies (${HDF5_LIBSH_TARGET} ${LINK_COMP_LIBS})
endif ()
endif ()
endif ()
#-----------------------------------------------------------------------------
# Option to build documentation
#-----------------------------------------------------------------------------
option (HDF5_BUILD_DOC "Build documentation" OFF)
if (HDF5_BUILD_DOC AND EXISTS "${HDF5_DOXYGEN_DIR}" AND IS_DIRECTORY "${HDF5_DOXYGEN_DIR}")
# check if Doxygen is installed
find_package(Doxygen)
if (DOXYGEN_FOUND)
message(STATUS "Doxygen version: ${DOXYGEN_VERSION}")
add_subdirectory (doxygen)
else ()
message(STATUS "Doxygen needs to be installed to generate the doxygen documentation")
endif ()
endif ()
#-----------------------------------------------------------------------------
# Dashboard and Testing Settings
#-----------------------------------------------------------------------------
option (BUILD_TESTING "Build HDF5 Unit Testing" ON)
if (BUILD_TESTING)
include (CMakeTests.cmake)
endif ()
#-----------------------------------------------------------------------------
# Option to build HDF5 Utilities
#-----------------------------------------------------------------------------
if (EXISTS "${HDF5_SOURCE_DIR}/utils" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/utils")
option (HDF5_BUILD_PARALLEL_TOOLS "Build Parallel HDF5 Tools" OFF)
if (HDF5_BUILD_PARALLEL_TOOLS AND HDF5_ENABLE_PARALLEL)
set (CMAKE_PREFIX_PATH "$HDF_RESOURCES_DIR")
find_package(MFU REQUIRED)
if (MFU_FOUND)
message(STATUS "LL_PATH=${LL_PATH}")
set (H5_HAVE_LIBMFU 1)
set (H5_HAVE_MFU_H 1)
set (CMAKE_REQUIRED_INCLUDES "${MFU_INCLUDE_DIR}")
set (MFU_LIBRARY_DEBUG "$MFU_LIBRARY")
set (MFU_LIBRARY_RELEASE "$MFU_LIBRARY")
endif ()
find_package(CIRCLE REQUIRED)
if (CIRCLE_FOUND)
set (H5_HAVE_LIBCIRCLE 1)
set (H5_HAVE_CIRCLE_H 1)
set (CMAKE_REQUIRED_INCLUDES "${CIRCLE_INCLUDE_DIR}")
endif ()
find_package(DTCMP REQUIRED)
if (DTCMP_FOUND)
set (H5_HAVE_LIBDTCMP 1)
set (H5_HAVE_DTCMP_H 1)
set (CMAKE_REQUIRED_INCLUDES "${DTCMP_INCLUDE_DIR}")
endif ()
endif ()
add_subdirectory (utils)
endif ()
#-----------------------------------------------------------------------------
# Option to build HDF5 Tools
#-----------------------------------------------------------------------------
if (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools")
option (HDF5_BUILD_TOOLS "Build HDF5 Tools" ON)
if (HDF5_BUILD_TOOLS)
add_subdirectory (tools)
endif ()
endif ()
#-----------------------------------------------------------------------------
# Include filter plugins
#-----------------------------------------------------------------------------
include (CMakePlugins.cmake)
if (HDF5_PACKAGE_EXTLIBS AND NOT HDF5_NO_PACKAGES)
if (HDF5_ENABLE_PLUGIN_SUPPORT AND PLUGIN_FOUND)
PACKAGE_PLUGIN_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT})
# option (HDF5_TEST_PLUGIN "Execute plugin tests" ON)
# mark_as_advanced (HDF5_TEST_PLUGIN)
# TEST_PLUGIN_LIBRARY ()
endif ()
endif ()
#-----------------------------------------------------------------------------
# Option to build examples
#-----------------------------------------------------------------------------
if (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples")
option (HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" ON)
if (HDF5_BUILD_EXAMPLES)
add_subdirectory (examples)
endif ()
endif ()
#-----------------------------------------------------------------------------
# Option to build High Level API's
#-----------------------------------------------------------------------------
if (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl")
option (HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" ON)
if (HDF5_BUILD_HL_LIB)
set (H5_INCLUDE_HL 1)
add_subdirectory (hl)
endif ()
endif ()
#-----------------------------------------------------------------------------
# Option to build Fortran bindings/tests/examples
# Make sure this appears before the CONFIGURE_FILE step
# so that fortran name mangling is detected before writing H5pubconf.h
#-----------------------------------------------------------------------------
# Set default name mangling : overridden by Fortran detection in fortran dir
set (H5_FC_FUNC "H5_FC_FUNC(name,NAME) name ## _")
set (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) name ## _")
if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran")
option (HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF)
if (HDF5_BUILD_FORTRAN)
include (${HDF_RESOURCES_DIR}/HDFUseFortran.cmake)
message (VERBOSE "Fortran compiler ID is ${CMAKE_Fortran_COMPILER_ID}")
include (${HDF_RESOURCES_DIR}/HDFFortranCompilerFlags.cmake)
include (${HDF_RESOURCES_DIR}/HDF5UseFortran.cmake)
set (LINK_Fortran_LIBS ${LINK_LIBS})
if (NOT H5_FORTRAN_HAVE_ISO_C_BINDING)
message (FATAL_ERROR " **** Fortran compiler lacks required Fortran 2003 features; unsupported Fortran 2003 compiler, disable HDF5_BUILD_FORTRAN **** ")
endif ()
# Parallel IO usage requires MPI to be Linked and Included
if (H5_HAVE_PARALLEL)
find_package(MPI REQUIRED COMPONENTS Fortran)
set (LINK_Fortran_LIBS ${LINK_Fortran_LIBS} ${MPI_Fortran_LIBRARIES})
if (MPI_Fortran_LINK_FLAGS)
set (CMAKE_Fortran_EXE_LINKER_FLAGS "${MPI_Fortran_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}")
endif ()
endif ()
#option (HDF5_INSTALL_MOD_FORTRAN "Copy FORTRAN mod files to include directory (NO SHARED STATIC)" "NO")
set (HDF5_INSTALL_MOD_FORTRAN "SHARED" CACHE STRING "Copy FORTRAN mod files to include directory (NO SHARED STATIC)")
set_property (CACHE HDF5_INSTALL_MOD_FORTRAN PROPERTY STRINGS NO SHARED STATIC)
if (NOT HDF5_INSTALL_MOD_FORTRAN MATCHES "NO")
if (NOT BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS)
set (HDF5_INSTALL_MOD_FORTRAN "STATIC")
elseif (BUILD_SHARED_LIBS AND NOT BUILD_STATIC_LIBS)
set (HDF5_INSTALL_MOD_FORTRAN "SHARED")
endif ()
endif ()
add_subdirectory (fortran)
if (HDF5_BUILD_HL_LIB)
if (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran")
#-- Build the High Level Fortran source codes
add_subdirectory (hl/fortran)
endif ()
endif ()
endif ()
endif ()
#-----------------------------------------------------------------------------
# Option to build HDF5 C++ Library
#-----------------------------------------------------------------------------
if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++")
option (HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" OFF)
if (HDF5_BUILD_CPP_LIB)
# check for unsupported options
if (HDF5_ENABLE_PARALLEL)
if (NOT ALLOW_UNSUPPORTED)
message (FATAL_ERROR " **** Parallel and C++ options are mutually exclusive, override with ALLOW_UNSUPPORTED option **** ")
else ()
message (VERBOSE " **** Allowing unsupported Parallel and C++ options **** ")
endif ()
endif ()
include (${HDF_RESOURCES_DIR}/HDFCXXCompilerFlags.cmake)
add_subdirectory (c++)
if (HDF5_BUILD_HL_LIB)
if (EXISTS "${HDF5_SOURCE_DIR}/hl/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/c++")
#-- Build the High Level Fortran source codes
add_subdirectory (hl/c++)
endif ()
endif ()
endif ()
endif ()
#-----------------------------------------------------------------------------
# Check if Fortran's default real is double precision. If it is and HL is
# being built then configure should fail due to bug HDFFV-889.
#-----------------------------------------------------------------------------
if (HDF5_BUILD_FORTRAN AND HDF5_BUILD_HL_LIB)
if (NOT H5_FORTRAN_DEFAULT_REAL_NOT_DOUBLE)
message (FATAL_ERROR " **** Fortran high-level routines are not supported when the default REAL is DOUBLE PRECISION, use HDF5_BUILD_HL_LIB:BOOL=OFF **** ")
endif ()
endif ()
#-----------------------------------------------------------------------------
# Option to build HDF5 Java Library
#-----------------------------------------------------------------------------
if (EXISTS "${HDF5_SOURCE_DIR}/java" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/java")
option (HDF5_BUILD_JAVA "Build Java HDF5 Library" OFF)
if (HDF5_BUILD_JAVA)
add_subdirectory (java)
endif ()
endif ()
#-----------------------------------------------------------------------------
# Generate the H5pubconf.h file containing user settings needed by compilation
#-----------------------------------------------------------------------------
configure_file (${HDF_RESOURCES_DIR}/H5pubconf.h.in ${HDF5_SRC_BINARY_DIR}/H5pubconf.h @ONLY)
include (CMakeInstallation.cmake)