From a06daecb6a906887283bb3fae0ccf2ab0326fa50 Mon Sep 17 00:00:00 2001 From: Philippe Leprince Date: Wed, 3 Apr 2024 17:09:13 +0200 Subject: [PATCH] fix: debug and static builds should work. Signed-off-by: Philippe Leprince --- cmake/LibraryDefine.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmake/LibraryDefine.cmake b/cmake/LibraryDefine.cmake index 17b1a403d4..241cc1ea0f 100644 --- a/cmake/LibraryDefine.cmake +++ b/cmake/LibraryDefine.cmake @@ -38,7 +38,11 @@ function(OPENEXR_DEFINE_LIBRARY libname) message(STATUS ">> BLOSC2_LIB_NAME: ${BLOSC2_LIB_NAME}") target_include_directories(${objlib} PRIVATE ${BLOSC2_INCLUDE_DIRS}) target_link_directories(${objlib} PRIVATE ${BLOSC2_LIB_DIR}) - target_link_libraries(${objlib} PRIVATE "dl" ${BLOSC2_LIB_NAME}$<$:${CMAKE_DEBUG_POSTFIX}>) + if(BUILD_SHARED_LIBS) + target_link_libraries(${objlib} PRIVATE "dl" ${BLOSC2_LIB_NAME}$<$:${CMAKE_DEBUG_POSTFIX}>) + else() + target_link_libraries(${objlib} PUBLIC Blosc2::blosc2_static) + endif() if(TARGET blosc2_static) install(TARGETS blosc2_static EXPORT ${objlib}) endif()