Split static targets into separate optional target [UPDATED] (#6216)

Build-tree exports can't diverge from install-tree exports — the export(EXPORT ...) reads directly from the install export sets. No manual list to keep in sync.

Removed 3 global variables (HDF5_STATIC_LIBRARIES_TO_EXPORT, HDF5_JAVA_LIBRARIES_TO_EXPORT, HDF5_UTILS_TO_EXPORT) and their ~21 set_global_variable calls across tool/utility files.

Fixed the static-only build bug in the PR where the base export set was guarded by BUILD_SHARED_LIBS, breaking tools export.

Removed redundant utils in export files — the PR was dumping tools into all three build-tree export files (java, static, shared). Now they correctly appear only in the base export.
This commit is contained in:
Scot Breitenfeld
2026-02-24 17:04:25 -06:00
committed by GitHub
parent 3bd0f17857
commit a7ec64a857
11 changed files with 269 additions and 115 deletions
+1 -1
View File
@@ -110,7 +110,7 @@ if (HDF5_EXPORTED_TARGETS)
TARGETS
${HDF5_JAVA_JNI_LIB_TARGET}
EXPORT
${HDF5_EXPORTED_TARGETS}
${HDF5_EXPORTED_TARGETS}_java
LIBRARY DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT libraries
ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT libraries
RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT libraries