diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2021-04-04 12:09:23 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2021-04-06 12:36:31 (GMT) |
commit | 78287ec0af1eb5f968df09c8b4321dd56510a429 (patch) | |
tree | 69d52fe500f8e407349165646633938fc101e883 /Modules | |
parent | 3654068e80247f4f06a951d258f254da70aeef89 (diff) | |
download | CMake-78287ec0af1eb5f968df09c8b4321dd56510a429.zip CMake-78287ec0af1eb5f968df09c8b4321dd56510a429.tar.gz CMake-78287ec0af1eb5f968df09c8b4321dd56510a429.tar.bz2 |
FindHDF5: track the "main" library for each language
This will be used to build up additional include paths to search.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindHDF5.cmake | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index 7bacfac..7eec6de 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -811,6 +811,9 @@ if( NOT HDF5_FOUND ) endif() foreach(_lang IN LISTS HDF5_LANGUAGE_BINDINGS) + # The "main" library. + set(_hdf5_main_library "") + # find the HDF5 libraries foreach(LIB IN LISTS HDF5_${_lang}_LIBRARY_NAMES) if(HDF5_USE_STATIC_LIBRARIES) @@ -841,6 +844,15 @@ if( NOT HDF5_FOUND ) ${_HDF5_SEARCH_OPTS} ) + # Set the "main" library if not already set. + if (NOT _hdf5_main_library) + if (HDF5_${LIB}_LIBRARY_RELEASE) + set(_hdf5_main_library "${HDF5_${LIB}_LIBRARY_RELEASE}") + elseif (HDF5_${LIB}_LIBRARY_DEBUG) + set(_hdf5_main_library "${HDF5_${LIB}_LIBRARY_DEBUG}") + endif () + endif () + select_library_configurations( HDF5_${LIB} ) list(APPEND HDF5_${_lang}_LIBRARIES ${HDF5_${LIB}_LIBRARY}) endforeach() @@ -861,6 +873,8 @@ if( NOT HDF5_FOUND ) set(HDF5_INCLUDE_FILENAME hdf5.h) endif() + unset(_hdf5_main_library) + find_path(HDF5_${_lang}_INCLUDE_DIR ${HDF5_INCLUDE_FILENAME} HINTS ${HDF5_ROOT} PATHS $ENV{HOME}/.local/include |