Commit Graph

112 Commits

Author SHA1 Message Date
Brad King
eb705b9531 Update links to gitlab.kitware.com repos to add -/
GitLab now uses a `/-/` component between the `group/project` part of
the URL and the `{issues,merge_requests,tree}` part so that it can
support `group/subgroup/project` with arbitrary depth.
2020-05-26 11:38:01 -04:00
Seth R Johnson
8fa58aea77 FindHDF5: Clean variables and output
The module's functionality is preserved.  Perform cleanups:

- Format some functions
- Change macros to functions
- Fix return value check from execute_process
- Hide status messages unless HDF5_FIND_DEBUG is enabled
- Normalize TRUE/FALSE capitalization

Fixes: #20718
2020-05-18 12:40:01 -04:00
Brad King
506ffedf6c Merge topic 'FindHDF5-docs'
88cffab75f FindHDF5: docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4343
2020-02-12 09:20:59 -05:00
Michael Hirsch, Ph.D
88cffab75f
FindHDF5: docs
The docs referred to deprecated variables and HDF5_ROOT, which is
implicit for every Find*.
2020-02-11 11:11:42 -05:00
Michael Hirsch, Ph.D
659e46b99b FindHDF5: Improve search when not using HDF5 compiler wrapper
Add common lib/inc path_suffixes.
2020-02-11 10:42:41 -05:00
Michael Hirsch, Ph.D
d9e39f3f89 FindHDF5: check that compiler wrapper can compile a minimal program
There are common setups where the compiler wrapper is broken and will
give non-useful flags to CMake.
2020-02-11 10:42:41 -05:00
Willem Deconinck
08f4b5dcf9 FindHDF5: Append hdf5 to hdf5_hl to avoid undefined references 2019-10-15 09:47:58 -04:00
Willem Deconinck
cd6f0ef35a FindHDF5: Cray HDF5 Fortran module filename is usually capitalized 2019-10-15 09:47:58 -04:00
Bartosz Kosiorek
cb811d11ce Help: Improve description of modules 2019-04-23 10:39:34 +02:00
Michael Hirsch, Ph.D
d3d9e6b760 FindHDF5: Modernize formatting of variable documentation 2019-02-07 06:47:07 -05:00
Michael Hirsch, Ph.D
acbd69c219 FindHDF5: Use execute_process instead of exec_program 2019-02-07 06:47:07 -05:00
Mouginot B
4e174e0960 FindHDF5: Fix search for static hdf5_hl on Windows
The change in commit v3.10.0-rc1~411^2~1 (FindHDF5: Add support for
HDF5_USE_STATIC_LIBRARIES on Windows, 2017-07-03) accidentally left
out a `lib` prefix on the static library name of `hdf5_hl`.  It was
done correctly already for the main `hdf5` library.
2018-12-06 10:43:29 -05:00
Kitware Robot
df4ed1e9ff Help: Convert remaining modules to block-style comments 2018-10-22 11:09:34 -04:00
Brad King
a16930167d Merge topic 'FindHDF5-c-version'
a6abb6c8 FindHDF5: Fix H5_VERSION on Patch in C

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1465
2017-11-09 08:30:19 -05:00
Axel Huebl
a6abb6c8b6 FindHDF5: Fix H5_VERSION on Patch in C
Fix a typo from commit v3.6.0-rc1~85^2 (HDF5: Refactor the use of
compiler wrappers, 2016-04-04) that accidentally used the HDF5 C++
version (which could be empty) while detecting the C patch version.
The detection failed for patch releases, such as `1.10.0-patch1`
becoming `.1` instead of `1.10.0.1`.
2017-11-08 09:35:45 -05:00
luzpaz
777e87ae00 Fix trivial typos in text
Some are user facing.

Found using

    codespell -q 3 --skip="./Utilities" -I .cmake-whitelist.txt`

whereby the whitelist contained:

    ans
    dum
    helpfull
    emmited
    emmitted
    buil
    iff
    isnt
    nto
    ot
    pathes
    substract
    te
    todays
    upto
    whitespaces
2017-11-03 10:25:05 -04:00
Kris Thielemans
4956fc26b5 FindHDF5: fixes for HL when using an imported config
- some variables did not have the appropriate HL infix
- some logic was not yet implemented for HL
2017-08-03 09:49:47 -04:00
Kris Thielemans
4150048a3b FindHDF5: unset some variables
prefixed some local variables with _hdf5 and unset them at the end
(still more of these to do)
2017-08-03 09:49:47 -04:00
Kris Thielemans
9310d00822 FindHDF5: for a static imported config, use CONFIG-specific library
first check the LOCATION_<CONFIG> propertiy to find the library, then
LOCATION
2017-08-03 09:49:47 -04:00
Kris Thielemans
fc9828448d FindHDF5: fix hdf5-config case with more than one configuration
Select a configuration as the first of the following available:

* MAP_IMPORTED_CONFIG_<CONFIG>
* ${CMAKE_BUILD_TYPE}, RELWITHDEBINFO, RELEASE, DEBUG
* First entry in IMPORTED_CONFIGURATIONS

Fixes: #17039
2017-08-03 09:48:19 -04:00
Kris Thielemans
6848ff4ce5 FindHDF5: Define H5_BUILT_AS_DYNAMIC_LIB when using Windows DLLs
When searching for shared libraries on Windows, add
H5_BUILT_AS_DYNAMIC_LIB to HDF5_DEFINITIONS so that the header file
knows how to dllimport the symbols.
2017-07-07 08:58:57 -04:00
Kris Thielemans
6f131f49ee FindHDF5: Add support for HDF5_USE_STATIC_LIBRARIES on Windows
Also add the `_D` suffix for debug libraries.
2017-07-07 08:58:37 -04:00
Chuck Atkins
8b9d8c4ddc FindHDF5: Fix parallel detection when primary compiler is an HDF5 wrapper
This is covering a different use case where your primary compilers are
HDF5 wrappers, as is the case when using the Cray Programming
Environment. The existing code tries to query the compiler using options
only available to h5cc and friends, which doesn't work when your wrapper
is not h5cc, as is the case with the CrayPE. This change instead pulls
strings out of a test binary when testing for "is your regular compiler
an HDF5 wrapper" while the "query wrapper for options" is reserved for
the "I found the hdf5 wrappers but they're not your main compiler" mode.
2017-06-16 11:40:02 -04:00
Christian Pfeiffer
28d8383797 separgs: Use NATIVE_COMMAND where appropriate 2017-04-26 20:34:23 +02:00
Brad King
2c55c143c8 Merge branch 'backport-FindHDF5-optional-no-config' into FindHDF5-optional-no-config 2017-03-21 13:12:16 -04:00
Brad King
63c0ba5ff1 FindHDF5: Improve HDF5_ROOT and HDF5_FIND_DEBUG documentation 2017-03-21 13:11:36 -04:00
Brad King
9753d4c27e FindHDF5: Add option to skip finding package configuration file
Some projects may not be prepared to use the imported targets defined by
the HDF5 package configuration file.  Give users a way to skip this part
of the search.

Issue: #16718
2017-03-21 13:07:07 -04:00
Brad King
2df8aa0c80 FindHDF5: Improve HDF5_ROOT variable documentation 2017-03-21 13:02:36 -04:00
Brad King
0e8b83a1b7 Merge topic 'FindHDF5-fix-quoting'
8214061d FindHDF5: fix quoting

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !587
2017-03-21 09:58:18 -04:00
Ben Boeckel
8214061d1a FindHDF5: fix quoting 2017-03-15 12:54:19 -04:00
Kris Thielemans
c6bef559f3 FindHDF5: set HDF5_<lang>_INCLUDE_DIRS in all cases
In the case that we're using `find_path` to find the include directory,
only the `_DIR` variable was set, while in all other cases only the
`_DIRS` variable was set.  Set the `_DIRS` variable in all cases (while
keeping `_DIR` as result of `find_path`).  Also document the `_DIRS`
variable.

Fixes: #16694
2017-03-06 13:09:49 -05:00
Brad King
add3b1ee4f Merge topic 'FindHDF5-fix-definitions'
ea2a8dd2 FindHDF5: Restore `-D` in HDF5_DEFINITIONS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !554
2017-03-06 12:56:51 -05:00
Kris Thielemans
ea2a8dd268 FindHDF5: Restore -D in HDF5_DEFINITIONS
Changes in commit v3.8.0-rc1~7^2~5 (FindHDF5: Fix command-line parsing
argument extraction order, 2017-02-02) accidentally dropped `-D` from
preprocessor definition flags extracted from the HDF5 compiler wrappers.

Fixes: #16693
2017-03-06 12:48:49 -05:00
Kris Thielemans
2186b323c0 FindHDF5: initialize HDF5_DEFINITIONS when using hdf5-config.cmake 2017-03-01 08:13:58 -05:00
Kris Thielemans
16f1dd0d16 FindHDF5: document HDF5_<LANG>_DEFINITIONS 2017-03-01 08:13:58 -05:00
Kris Thielemans
b2de6da2f1 FindHDF5: use import libraries when using hdf5-config.cmake on Windows
The `LOCATION` of imported shared libraries on Windows is that of the
`.dll`.  Use the import library instead to get the `.lib` to be linked.

Fixes: #16534
2017-03-01 08:12:56 -05:00
Kris Thielemans
003c91385a FindHDF5: do not cache library locations when using hdf5-config.cmake
The imported targets provide a persistent reference of their location,
so we do not need to cache the values.
2017-03-01 08:11:37 -05:00
Kris Thielemans
bf67fff035 FindHDF5: recognize hdf5:: prefix when using hdf5-config.cmake
Some versions of HDF5 use this prefix on their imported targets.
2017-03-01 08:11:22 -05:00
Kris Thielemans
e629be4a7a FindHDF5: fix typo in comment 2017-03-01 08:06:26 -05:00
Kris Thielemans
1c7a9119d2 FindHDF5: remove mark_as_advanced for non-cached variables 2017-03-01 08:06:26 -05:00
Kris Thielemans
8250a520aa FindHDF5: add HDF5_FIND_DEBUG variable to get debugging output 2017-02-28 16:10:11 -05:00
Kris Thielemans
4b847f12f6 FindHDF5: hide HDF5_DIR if HDF5 was found in another way 2017-02-28 16:01:04 -05:00
Brad King
96d6139386 FindHDF5: Fix search for language-specific header file
Refactoring in commit v3.6.0-rc1~85^2 (HDF5: Refactor the use of
compiler wrappers, 2016-04-04) converted code of the form

    if(${LANGUAGE} MATCHES ...)

to

    if(LANGUAGE MATCHES ...)

However, `LANGUAGE` is a foreach() loop variable and not a normal
variable so auto-dereference does not occur.  Restore the explicit `${}`
syntax and use the new name of the loop variable that has changed since
then too.

Fixes: #16651
2017-02-17 09:25:46 -05:00
Brad King
28bb68e347 FindHDF5: Restore HDF5_<LANG>_INCLUDE_DIR advanced cache entry mark
Refactoring in commit v3.6.0-rc1~72^2 (HDF5: Rework component searching
to correctly find HL for all bindings, 2016-05-12) renamed the language
loop variable used to construct the name of `HDF5_<LANG>_INCLUDE_DIR`
but forgot to update it in the `mark_as_advanced` call.  Fix it now.

Issue: #16651
2017-02-17 09:10:03 -05:00
Brad King
cf0d8f1fd6 FindHDF5: Restore HDF5_INCLUDE_DIR in all code paths
This compatibility variable should be set no matter which method was
used to find HDF5.  Even if `HDF5_INCLUDE_DIRS` was set by copying the
`HDF5_INCLUDE_DIR` value from `hdf5-config.cmake` it will not hurt to
copy the same value back.

Issue: #16566
2017-02-03 10:57:10 -05:00
Brad King
5564c01703 FindHDF5: Restore fallback to static libraries
Since commit v3.6.1~6^2~2 (FindHDF5: Fix h5cc arg parsing to work with
homebrew on Mac, 2016-07-11) we treated `HDF5_USE_STATIC_LIBRARIES` OFF
as a requirement for shared libraries.  It is just supposed to be a
preference.  Even if `HDF5_USE_STATIC_LIBRARIES` is not set we should
still fall back to finding static libraries if shared libraries are not
available.

Issue: #16566
2017-02-03 09:12:06 -05:00
Brad King
4908969f57 FindHDF5: Fix search with HDF5_ROOT
Refactoring in commit v3.6.0-rc1~72^2 (HDF5: Rework component searching
to correctly find HL for all bindings, 2016-05-12) turned off a large
amount of its logic when HDF5_ROOT is set.  This caused use of the hdf5
compiler wrapper to extract all needed libraries (e.g. z, dl as
dependencies of hdf5 static libraries) to be skipped when using
HDF5_ROOT.

Fix the search logic to honor HDF5_ROOT in all code paths.  Restrict the
search for hdf5-specific components to this root, but allow external
libraries to be found anywhere.

Fixes: #16566
2017-02-03 09:12:05 -05:00
Brad King
77f6d22ad1 FindHDF5: Use keywords in find_library calls
Clarify the purpose of each argument.
2017-02-03 09:12:05 -05:00
Brad King
3d5ad7236c FindHDF5: Initialize/finalize internal search options variable
While at it, use a more private name.
2017-02-03 09:12:05 -05:00
Brad King
ae89967f9d FindHDF5: Fix command-line parsing argument extraction order
Re-implement our internal `_HDF5_parse_compile_line` helper to process
command line arguments all at once and in order.  Otherwise the
libraries named by absolute path and those named by `-l` arguments are
not kept in order.

The new implementation will not handle separate arguments like
`-I /path/to/include/dir` but I have not seen the HDF5 compiler
wrappers produce this form.  If necessary the parsing loop can
be extended with a state variable to keep track of such pairs.
2017-02-03 09:12:04 -05:00