Conversation
|
cc @dg0yt |
| endif () | ||
| target_include_directories(gdal_HDF5 SYSTEM PRIVATE ${HDF5_INCLUDE_DIRS}) | ||
| -gdal_target_link_libraries(gdal_HDF5 PRIVATE ${HDF5_C_LIBRARIES}) | ||
| +target_link_libraries(gdal_HDF5 PRIVATE ${HDF5_C_LIBRARIES}) |
There was a problem hiding this comment.
function(gdal_target_interfaces _TARGET)
foreach (_LIB IN ITEMS ${ARGN})
if (TARGET ${_LIB})
get_property(_res TARGET ${_LIB} PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
if (_res)
target_include_directories(${_TARGET} PRIVATE ${_res})
endif ()
get_property(_res TARGET ${_LIB} PROPERTY INTERFACE_COMPILE_DEFINITIONS)
if (_res)
target_compile_definitions(${_TARGET} PRIVATE ${_res})
endif ()
get_property(_res TARGET ${_LIB} PROPERTY INTERFACE_COMPILE_OPTIONS)
if (_res)
target_compile_options(${_TARGET} PRIVATE ${_res})
endif ()
endif ()
endforeach ()
endfunction()function (gdal_add_private_link_libraries)
get_property(tmp GLOBAL PROPERTY gdal_private_link_libraries)
foreach (arg ${ARGV})
set(tmp ${tmp} ${arg})
endforeach ()
set_property(GLOBAL PROPERTY gdal_private_link_libraries ${tmp})
endfunction (gdal_add_private_link_libraries)So cmake will not add the INTERFACE_INCLUDE_DIRECTORIES.
There was a problem hiding this comment.
So cmake will not add the
INTERFACE_INCLUDE_DIRECTORIES.
There is target_include_directories(gdal_HDF5 SYSTEM PRIVATE ${HDF5_INCLUDE_DIRS}) (line 24), and this is enough.
GDAL is meant to use CMake's FindHDF5.cmake. And this passed CI in GDAL and in vcpkg. Multiple times.
This doesn't mean there couldn't bea broken configuration. But you have to clearly identify this configuration (for a clean start). And you proabbly have to find and fix it in the vicinity of port hdf5.
And there are configuration options which might remove the need for patching. It is just not clear enough what you try to fix.
There was a problem hiding this comment.
The problem is that neither vcpkg-cmake-wrapper nor hdf5-config.cmake provide HDF5_INCLUDE_DIRS.
There was a problem hiding this comment.
No. The problem is install port hdf5 without cpp breaking CMake's FindHDF5.cmake. Cf. #25645
|
In favor of #25646 |
Related: #22392 (comment)