View | Details | Raw Unified | Return to problem 2426
Collapse All | Expand All

(-)a/cmake/History (+5 lines)
Lines 30-35 add this in the documentation for the changed file as [BUGFIX #BUGNUMBER]. Link Here
30
30
31
     ----------------------------------------------------------
31
     ----------------------------------------------------------
32
32
33
24th September 2021 - Ben Morgan (cmake-V10-06-53)
34
- Rename Geant4::HDF5 to hdf5::hdf5 to be compatible with
35
  imported target provided since CMake 3.20.
36
- Backports !2107 to 10.7 to address Bugzilla 2426
37
33
19th March 2021 - Gunter Folger (cmake-V10-06-52)
38
19th March 2021 - Gunter Folger (cmake-V10-06-52)
34
- Update to older G4TENDL 1.3.2, 1.4 has problems.
39
- Update to older G4TENDL 1.3.2, 1.4 has problems.
35
40
(-)a/cmake/Modules/G4HDF5Shim.cmake (-8 / +8 lines)
Lines 1-10 Link Here
1
 # - G4HDF5Shim
1
# - G4HDF5Shim
2
#
2
#
3
# Geant4's Geant4Config.cmake file aims to support CMake 3.8 and newer
3
# Geant4's Geant4Config.cmake file aims to support CMake 3.8 and newer
4
# The HDF5 dependency is located through CMake's builtin FindHDF5
4
# The HDF5 dependency is located through CMake's builtin FindHDF5
5
# module, but this does not supply imported targets as of CMake 3.16.
5
# module, but this does not supply imported targets until CMake 3.20.
6
# It may use HDF5's hdf5-config.cmake file if available, so create
6
# It may use HDF5's hdf5-config.cmake file if available, so create
7
# custom imported target Geant4::HDF5 to allow both cases to be handled
7
# custom imported target hdf5::hdf5 to allow both cases to be handled
8
# without interference with either.
8
# without interference with either.
9
 
9
 
10
if(HDF5_FOUND)
10
if(HDF5_FOUND)
Lines 24-41 if(HDF5_FOUND) Link Here
24
   endif()
24
   endif()
25
 endif()
25
 endif()
26
26
27
 # As FindHDF5 does not yet supply imported targets, we
27
 # If FindHDF5 does not yet supply imported targets, we
28
 # create an internal INTERFACE target to wrap these.
28
 # create an internal INTERFACE target to wrap these.
29
 # This still hard-codes include/library paths, but limits it
29
 # This still hard-codes include/library paths, but limits it
30
 # to one place. Later, we'll create proper imported targets
30
 # to one place. Later, we'll create proper imported targets
31
 # with re-finds but for now this is the best minimally invasive proceedure
31
 # with re-finds but for now this is the best minimally invasive proceedure
32
 if(NOT TARGET Geant4::HDF5)
32
 if(NOT TARGET hdf5::hdf5)
33
   add_library(Geant4::HDF5 IMPORTED UNKNOWN)
33
   add_library(hdf5::hdf5 IMPORTED UNKNOWN)
34
   set_target_properties(Geant4::HDF5 PROPERTIES
34
   set_target_properties(hdf5::hdf5 PROPERTIES
35
     IMPORTED_LINK_INTERFACE_LANGUAGES "C"
35
     IMPORTED_LINK_INTERFACE_LANGUAGES "C"
36
     IMPORTED_LOCATION "${HDF5_C_LIBRARY_hdf5}"
36
     IMPORTED_LOCATION "${HDF5_C_LIBRARY_hdf5}"
37
     INTERFACE_INCLUDE_DIRECTORIES "${HDF5_C_INCLUDE_DIRS}"
37
     INTERFACE_INCLUDE_DIRECTORIES "${HDF5_C_INCLUDE_DIRS}"
38
     INTERFACE_LINK_LIBRARIES "${HDF5_C_LIBRARIES}"
38
     INTERFACE_LINK_LIBRARIES "${HDF5_C_LIBRARIES}"
39
     )
39
     )
40
 endif()
40
 endif()
41
endif()
41
endif()
(-)a/cmake/Modules/G4OptionalComponents.cmake (-1 / +1 lines)
Lines 392-398 if(GEANT4_USE_HDF5) Link Here
392
  find_package(HDF5 1.8 REQUIRED)
392
  find_package(HDF5 1.8 REQUIRED)
393
  include("${CMAKE_CURRENT_LIST_DIR}/G4HDF5Shim.cmake")
393
  include("${CMAKE_CURRENT_LIST_DIR}/G4HDF5Shim.cmake")
394
  # Backward compatibility
394
  # Backward compatibility
395
  set(HDF5_LIBRARIES Geant4::HDF5)
395
  set(HDF5_LIBRARIES hdf5::hdf5)
396
396
397
  # May have found via config mode...
397
  # May have found via config mode...
398
  if(HDF5_DIR)
398
  if(HDF5_DIR)

Return to problem 2426