ITK
ITK copied to clipboard
CMake attempts to set properties on hdf5-static instead of hdf5-shared when BUILD_STATIC_LIBS is set to OFF
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
- Configure CMake with
BUILD_STATIC_LIBS
set toOFF
- 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