Skip to content

Commit 41a04b4

Browse files
committed
Make libs discoverable at runtime
1 parent 5d4da34 commit 41a04b4

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,30 @@ else()
5454
include(FetchContent)
5555
FetchContent_Declare(blosc2
5656
GIT_REPOSITORY https://github.com/Blosc/c-blosc2
57-
GIT_TAG 5a2b0ed9c4d801230c118fbc5811817055b5a3f5 # v2.22.0
57+
GIT_TAG 2effe806e318f4d474705460b0a9a172b8e07ff9 # v2.22.0
5858
)
5959
FetchContent_MakeAvailable(blosc2)
6060
include_directories("${blosc2_SOURCE_DIR}/include")
6161
target_link_libraries(blosc2_ext PRIVATE blosc2_static)
6262
endif()
6363

64+
# TODO
65+
# CHECK THIS
66+
if(UNIX)
67+
set_target_properties(blosc2_ext PROPERTIES
68+
BUILD_WITH_INSTALL_RPATH TRUE
69+
INSTALL_RPATH "$<IF:$<PLATFORM_ID:Darwin>,@loader_path/lib,\$ORIGIN/lib>"
70+
)
71+
endif()
72+
73+
if(WIN32)
74+
add_custom_command(TARGET blosc2_ext POST_BUILD
75+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
76+
$<TARGET_FILE:blosc2_shared>
77+
$<TARGET_FILE_DIR:blosc2_ext>
78+
)
79+
endif()
80+
6481
# Python extension -> site-packages/blosc2
6582
install(
6683
TARGETS blosc2_ext

0 commit comments

Comments
 (0)