Open Jacobfaib opened 1 month ago
CMakeLists.txt has
CMakeLists.txt
if(NOT HDF5_VFD_GDS_INSTALL_BIN_DIR) set(HDF5_VFD_GDS_INSTALL_BIN_DIR ${CMAKE_INSTALL_PREFIX}/bin) endif() if(NOT HDF5_VFD_GDS_INSTALL_LIB_DIR) set(HDF5_VFD_GDS_INSTALL_LIB_DIR ${CMAKE_INSTALL_PREFIX}/lib) endif() if(NOT HDF5_VFD_GDS_INSTALL_INCLUDE_DIR) # Interface include will default to prefix/include set(HDF5_VFD_GDS_INSTALL_INTERFACE include) set(HDF5_VFD_GDS_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/include) else() set(HDF5_VFD_GDS_INSTALL_INTERFACE ${HDF5_VFD_GDS_INSTALL_INCLUDE_DIR}) endif() if(NOT HDF5_VFD_GDS_INSTALL_DATA_DIR) set(HDF5_VFD_GDS_INSTALL_DATA_DIR ${CMAKE_INSTALL_PREFIX}/share) endif()
The main issue is that this sets the install prefix in stone at configure-time, making any install-time prefix modifications impossible:
$ cmake --install build --prefix /another/prefix # does not do what you expect!
These should be amended to:
GNUInstallDirs
include(GNUInstallDirs) if(NOT HDF5_VFD_GDS_INSTALL_BIN_DIR) set(HDF5_VFD_GDS_INSTALL_BIN_DIR ${CMAKE_INSTALL_BINDIR}) endif() if(NOT HDF5_VFD_GDS_INSTALL_LIB_DIR) set(HDF5_VFD_GDS_INSTALL_LIB_DIR ${CMAKE_INSTALL_LIBDIR}) endif() if(NOT HDF5_VFD_GDS_INSTALL_INCLUDE_DIR) # Interface include will default to prefix/include set(HDF5_VFD_GDS_INSTALL_INTERFACE include) set(HDF5_VFD_GDS_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}) else() set(HDF5_VFD_GDS_INSTALL_INTERFACE ${HDF5_VFD_GDS_INSTALL_INCLUDE_DIR}) endif() if(NOT HDF5_VFD_GDS_INSTALL_DATA_DIR) set(HDF5_VFD_GDS_INSTALL_DATA_DIR ${CMAKE_INSTALL_DATAROOTDIR}) endif()
At install-time CMake will prefixes relative paths with CMAKE_INSTALL_PREFIX automatically, meaning that the behavior is unchanged.
CMAKE_INSTALL_PREFIX
CMakeLists.txt
hasThe main issue is that this sets the install prefix in stone at configure-time, making any install-time prefix modifications impossible:
These should be amended to:
GNUInstallDirs
variables for portability.At install-time CMake will prefixes relative paths with
CMAKE_INSTALL_PREFIX
automatically, meaning that the behavior is unchanged.