Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions config/install/hdf5-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/Modules")

string(TOUPPER @HDF5_PACKAGE@ HDF5_PACKAGE_NAME)

#-----------------------------------------------------------------------------
# Require that the package be requested as 'HDF5'.
#
# CMake's config-mode search matches the package name case-insensitively, so
# find_package (hdf5) succeeds, but CMake records that call's state
# under the caller's capitalization, which this file never reads. Require the
# uppercase name that FindHDF5.cmake also uses for consistency.
#-----------------------------------------------------------------------------
if (CMAKE_FIND_PACKAGE_NAME AND NOT CMAKE_FIND_PACKAGE_NAME STREQUAL HDF5_PACKAGE_NAME)
set (${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
set (${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE
"HDF5 must be requested as \"${HDF5_PACKAGE_NAME}\", not \"${CMAKE_FIND_PACKAGE_NAME}\". Use find_package (${HDF5_PACKAGE_NAME} ...) instead."
)
return ()
endif ()

set (${HDF5_PACKAGE_NAME}_VALID_COMPONENTS
static
shared
Expand Down
Loading