From ff3abc72712dbd677c141c9443a366677ef0b2cf Mon Sep 17 00:00:00 2001 From: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Date: Mon, 14 Mar 2022 07:14:44 -0500 Subject: 1.8 Update HDF5_ROOT usage (#1488) --- config/cmake/HDF518_Examples.cmake.in | 11 ++++++++--- config/cmake/HDFCXXCompilerFlags.cmake | 2 +- config/cmake_ext_mod/HDFMacros.cmake | 4 ++-- release_docs/RELEASE.txt | 11 +++++++++++ release_docs/USING_CMake_Examples.txt | 9 ++++----- release_docs/USING_HDF5_CMake.txt | 27 +++++++++++++++------------ 6 files changed, 41 insertions(+), 23 deletions(-) diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in index 0253d5d..c26c6bb 100644 --- a/config/cmake/HDF518_Examples.cmake.in +++ b/config/cmake/HDF518_Examples.cmake.in @@ -20,10 +20,13 @@ set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") if("@CMAKE_GENERATOR_TOOLSET@") set(CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") endif() +if("@CMAKE_GENERATOR_ARCHITECTURE@") + set(CMAKE_GENERATOR_ARCHITECTURE "@CMAKE_GENERATOR_ARCHITECTURE@") +endif() set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) # handle input parameters to script. -#INSTALLDIR - HDF5-1.8 root folder +#INSTALLDIR - HDF5 root folder #CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo #CTEST_SOURCE_NAME - name of source folder; HDF5Examples if(DEFINED CTEST_SCRIPT_ARG) @@ -80,17 +83,19 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDN ############################################################################################################### if(WIN32) set(SITE_OS_NAME "Windows") - set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake") + set(ENV{HDF5_ROOT} "${INSTALLDIR}") set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build) set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") else() - set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake") + set(ENV{HDF5_ROOT} "${INSTALLDIR}") set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib") set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") endif() +### default HDF5_PLUGIN_PATH to where the filter libraries are located +set(ENV{HDF5_PLUGIN_PATH} "${INSTALLDIR}/lib/plugin") if(${CDASH_LOCAL}) set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCDASH_LOCAL:BOOL=ON") endif() diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake index 0403834..958fe73 100644 --- a/config/cmake/HDFCXXCompilerFlags.cmake +++ b/config/cmake/HDFCXXCompilerFlags.cmake @@ -238,7 +238,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # Append more extra warning flags that only gcc 9.3+ knows about if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.3) - # do not use C warnings, gnu-warnings 9.3, no cxx warniings + # do not use C warnings, gnu-warnings 9.3, no cxx warnings # ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/9.3") endif () diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 6da2b74..53e9f8f 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -356,7 +356,7 @@ macro (HDF_DIR_PATHS package_prefix) endif () endif () if (NOT ${package_prefix}_INSTALL_CMAKE_DIR) - set (${package_prefix}_INSTALL_CMAKE_DIR share/cmake) + set (${package_prefix}_INSTALL_CMAKE_DIR cmake) endif () # Always use full RPATH, i.e. don't skip the full RPATH for the build tree @@ -427,7 +427,7 @@ macro (HDF_DIR_PATHS package_prefix) endif () endif () - if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + if (NOT ${package_prefix}_EXTERNALLY_CONFIGURED AND CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) if (CMAKE_HOST_UNIX) set (CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}" CACHE PATH "Install path prefix, prepended onto install directories." FORCE) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 1b25355..d28f162 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -237,6 +237,17 @@ Bug Fixes since HDF5-1.8.22 Configuration ------------- + - Reworked corrected path searched by CMake find_package command + + The install path for cmake find_package files had been changed to use + "share/cmake" + for all platforms. However setting the HDF5_ROOT variable failed to locate + the configuration files. The build variable HDF5_INSTALL_CMAKE_DIR is now + set to the /cmake folder. The location of the configuration + files can still be specified by the "HDF5_DIR" variable. + + (ADB - 2022/03/11) + - Corrected path searched by CMake find_package command The install path for cmake find_package files had been changed to use diff --git a/release_docs/USING_CMake_Examples.txt b/release_docs/USING_CMake_Examples.txt index 41bdc21..f72486f 100644 --- a/release_docs/USING_CMake_Examples.txt +++ b/release_docs/USING_CMake_Examples.txt @@ -20,15 +20,14 @@ Notes: This short instruction is written for users who want to quickly I. Preconditions ======================================================================== - 1. We suggest you obtain the latest CMake for windows from the Kitware - web site. The HDF5 1.8.x product requires a minimum CMake version + 1. We suggest you obtain the latest CMake for your platform from the Kitware + web site. The HDF5 1.10.x product requires a minimum CMake version of 3.12. If you are using VS2019, the minimum version is 3.15. 2. You have installed the HDF5 library built with CMake, by executing the HDF Install Utility (the *.msi file in the binary package for - Windows or the *.sh on Linux). If you are using a Windows platform, - you can obtain a pre-built Windows binary from The HDF Group's website - at www.hdfgroup.org. + Windows or the *.sh on Linux). You can obtain pre-built binaries + from The HDF Group's website at www.hdfgroup.org. diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index d11410c..0efb2a1 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -29,42 +29,45 @@ Notes: This short instruction is written for users who want to quickly of using a ctest script for building and testing. See INSTALL_CMake.txt for more information. + 4. See https://cmake.org/cmake/help/latest/command/find_package.html + for more information on the CMake "Config Mode Search Procedure". ======================================================================== I. Preconditions ======================================================================== - 1. We suggest you obtain the latest CMake for windows from the Kitware + 1. We suggest you obtain the latest CMake for your platform from the Kitware web site. The HDF5 1.8.x product requires a minimum CMake version - of 3.12. + of 3.12. If you are using VS2019, the minimum version is 3.15. 2. You have installed the HDF5 library built with CMake, by executing the HDF Install Utility (the *.msi file in the binary package for - Windows). You can obtain pre-built binaries from The HDF Group's website at - www.hdfgroup.org. + Windows or the *.sh on Linux). You can obtain pre-built binaries + from The HDF Group's website at www.hdfgroup.org. - 3. Set the environment variable HDF5_DIR to the installed location of - the config files for HDF5. + 3. Set the HDF5_ROOT CMake variable, -DHDF5_ROOT= + or environment variable, set(ENV{HDF5_ROOT} "") + to the installed location of HDF5. On Windows: - HDF5_DIR=C:/Program Files/HDF_Group/HDF5/1.10.x/cmake + HDF5_ROOT=C:/Program Files/HDF_Group/HDF5/1.8.x/ On unix: - HDF5_DIR=/HDF_Group/HDF5/1.10.x/cmake + HDF5_ROOT=/HDF_Group/HDF5/1.8.x/ If you are using shared libraries, you may need to add to the path environment variable. Set the path environment variable to the installed location of the library files for HDF5. On Windows (*.dll): - PATH=%PATH%;C:/Program Files/HDF_Group/HDF5/1.10.x/bin + PATH=%PATH%;C:/Program Files/HDF_Group/HDF5/1.8.x/bin On unix (*.so): - LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/HDF_Group/HDF5/1.10.x/lib + LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/HDF_Group/HDF5/1.8.x/lib If you are using filter plugin libraries, you will need to set the HDF5_PLUGIN_PATH environment variable. On Windows: - HDF5_PLUGIN_PATH=C:/Program Files/HDF_Group/HDF5/1.10.x/lib/plugin + HDF5_PLUGIN_PATH=C:/Program Files/HDF_Group/HDF5/1.8.x/lib/plugin On unix: - HDF5_PLUGIN_PATH=/HDF_Group/HDF5/1.10.x/lib/plugin + HDF5_PLUGIN_PATH=/HDF_Group/HDF5/1.8.x/lib/plugin (Note there are no quote characters used on Windows and all platforms use forward slashes) -- cgit v0.12