ITK icon indicating copy to clipboard operation
ITK copied to clipboard

CMake attempts to set properties on hdf5-static instead of hdf5-shared when BUILD_STATIC_LIBS is set to OFF

Open rdebroiz opened this issue 4 months ago • 12 comments

Description

CMake attempts to properties on hdf5-static instead of hdf5-shared when BUILD_STATIC_LIBS is set to OFF

https://github.com/InsightSoftwareConsortium/ITK/blob/15af3aed65693811448c9af22ce9d09ff9f3000a/Modules/ThirdParty/HDF5/CMakeLists.txt#L84

The test to decide if it is shared or static is performed on BUILD_SHARED_LIBS, perhaps it should be done on BUILD_STATIC_LIBS ?

If one manually set BUILD_SHARED_LIBS to ON in the CMake cache, it fixes the issue.

Steps to Reproduce

  1. Configure CMake with BUILD_STATIC_LIBS set to OFF
  2. Get:
set_property could not find TARGET hdf5-static.  
Perhaps it has not yet been created.
Call Stack (most recent call first):
  CMake/ITKModuleMacros.cmake:464 (itk_module_target_name)
  Modules/ThirdParty/HDF5/src/CMakeLists.txt:106 (itk_module_target)

Versions

v5.4.0

Environment

CMake 3.29.6

rdebroiz avatar Oct 15 '24 12:10 rdebroiz