IOVeraOut.dir/build.make:89: *** target pattern contains no '%'. Stop
Cross-compiling current master with MinGW, aborts at 'make' because the build script of target IOVeraOut contains an invalid path:
bin/libvtkIOVeraOut-8.90.dll: lib/libvtkCommonMath-8.90.dll.a
bin/libvtkIOVeraOut-8.90.dll: lib/libvtkCommonCore-8.90.dll.a
bin/libvtkIOVeraOut-8.90.dll: lib/libvtksys-8.90.dll.a
bin/libvtkIOVeraOut-8.90.dll: hdf5::hdf5-NOTFOUND
bin/libvtkIOVeraOut-8.90.dll: hdf5::hdf5_hl-NOTFOUND
bin/libvtkIOVeraOut-8.90.dll: IO/VeraOut/CMakeFiles/IOVeraOut.dir/linklibs.rsp
if I debug the detection of hdf5 with '-DHDF5_FIND_DEBUG=1' we see vtk detects hdf5 fine (I use VTK_MODULE_USE_EXTERNAL_VTK_hdf5=ON):
-- HDF5_DIR: HDF5_DIR-NOTFOUND
-- HDF5_DEFINITIONS: -DH5_BUILT_AS_DYNAMIC_LIB
-- HDF5_INCLUDE_DIRS: /usr/i686-w64-mingw32/include
-- HDF5_LIBRARIES: /usr/i686-w64-mingw32/lib/libhdf5.dll.a
-- HDF5_HL_LIBRARIES: /usr/i686-w64-mingw32/lib/libhdf5_hl.dll.a
-- HDF5_C_DEFINITIONS:
-- HDF5_C_INCLUDE_DIR: /usr/i686-w64-mingw32/include
-- HDF5_C_INCLUDE_DIRS: /usr/i686-w64-mingw32/include
-- HDF5_C_LIBRARY:
-- HDF5_C_LIBRARIES: /usr/i686-w64-mingw32/lib/libhdf5.dll.a
-- HDF5_C_HL_LIBRARY:
-- HDF5_C_HL_LIBRARIES: /usr/i686-w64-mingw32/lib/libhdf5_hl.dll.a
We see here that I have the shared versions
So what doesnt work is the expansion of the imported target location from vtk's FindHDF5.cmake
if (WIN32)
set(_hdf5_location_property "IMPORTED_IMPLIB")
else ()
set(_hdf5_location_property "IMPORTED_LOCATION")
endif ()
...
add_library("hdf5::${hdf5_target_name}" "${_hdf5_libtype}" IMPORTED)
set_target_properties("hdf5::${hdf5_target_name}" PROPERTIES
"${_hdf5_location_property}" "${_hdf5_location}"
INTERFACE_INCLUDE_DIRECTORIES "${HDF5_${hdf5_lang}_HL_INCLUDE_DIRS}"
INTERFACE_COMPILE_DEFINITIONS "${_hdf5_definitions}")
Here the problem is for IMPORTED_IMPLIB property is used while _hdf5_libtype is set to STATIC: it should be SHARED.
THe variable _hdf5_libtype is set by vtk_detect_library_type, but I see that this macro only check if the path ends with '.a' (STATIC) or '.dll' (SHARED) while it doesnt look at CMAKE_IMPORT_LIBRARY_SUFFIX which is '.dll.a':
string(LENGTH "${CMAKE_SHARED_LIBRARY_SUFFIX}" vdlt_shared_suffix_len)
math(EXPR vdlt_shared_idx "${vdlt_path_len} - ${vdlt_shared_suffix_len}")
string(SUBSTRING "${vdlt_PATH}" "${vdlt_shared_idx}" -1 vdlt_shared_check)
string(LENGTH "${CMAKE_STATIC_LIBRARY_SUFFIX}" vdlt_static_suffix_len)
math(EXPR vdlt_static_idx "${vdlt_path_len} - ${vdlt_static_suffix_len}")
string(SUBSTRING "${vdlt_PATH}" "${vdlt_static_idx}" -1 vdlt_static_check)
if (vdlt_shared_check STREQUAL CMAKE_SHARED_LIBRARY_SUFFIX)
set(vdlt_type SHARED)
elseif (vdlt_static_check STREQUAL CMAKE_STATIC_LIBRARY_SUFFIX)
set(vdlt_type STATIC)
endif ()