From 01cfe792f9b6adab2e1f7cc03eb6f8f90fe3cb7d Mon Sep 17 00:00:00 2001 From: Matthew Larson Date: Wed, 30 Aug 2023 12:16:58 -0500 Subject: [PATCH] Prevent linking both static/shared libs --- CMakeVOL.cmake | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/CMakeVOL.cmake b/CMakeVOL.cmake index afb2996dcbb..4a50e0d46e0 100644 --- a/CMakeVOL.cmake +++ b/CMakeVOL.cmake @@ -34,17 +34,14 @@ if (HDF5_VOL_ALLOW_EXTERNAL) message (FATAL_ERROR "HDF5_ALLOW_EXTERNAL_SUPPORT must be set to 'GIT' to allow building of external HDF5 VOL connectors") endif () - set (HDF5_LIB_TARGETS "") - set (HDF5_HL_LIB_TARGETS "") - - if (BUILD_STATIC_LIBS) - list(APPEND HDF5_LIB_TARGETS ${HDF5_LIB_TARGET}) - list(APPEND HDF5_HL_LIB_TARGETS ${HDF5_HL_LIB_TARGET}) - endif() - if (BUILD_SHARED_LIBS) - list(APPEND HDF5_LIB_TARGETS ${HDF5_LIBSH_TARGET}) - list(APPEND HDF5_HL_LIB_TARGETS ${HDF5_HL_LIBSH_TARGET}) + set(HDF5_LIB_TARGETS ${HDF5_LIBSH_TARGET}) + set(HDF5_HL_LIB_TARGETS ${HDF5_HL_LIBSH_TARGET}) + else () + if (BUILD_STATIC_LIBS) + set(HDF5_LIB_TARGETS ${HDF5_LIB_TARGET}) + set(HDF5_HL_LIB_TARGETS ${HDF5_HL_LIB_TARGET}) + endif() endif() # For compatibility, set some variables that projects would