File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -34,9 +34,23 @@ if(zstd_FOUND)
34
34
if (zstd_LIBRARY MATCHES "${zstd_SHARED_LIBRARY_SUFFIX} $" AND
35
35
NOT TARGET zstd::libzstd_shared )
36
36
add_library (zstd::libzstd_shared SHARED IMPORTED )
37
- set_target_properties (zstd::libzstd_shared PROPERTIES
37
+ if (MSVC )
38
+ # IMPORTED_LOCATION is the path to the DLL and IMPORTED_IMPLIB is the "library".
39
+ get_filename_component (zstd_DIRNAME "${zstd_LIBRARY} " DIRECTORY )
40
+ string (REGEX REPLACE "${CMAKE_INSTALL_LIBDIR} $" "${CMAKE_INSTALL_BINDIR} " zstd_DIRNAME "${zstd_DIRNAME} " )
41
+ get_filename_component (zstd_BASENAME "${zstd_LIBRARY} " NAME )
42
+ string (REGEX REPLACE "\\ ${CMAKE_LINK_LIBRARY_SUFFIX} $" "${CMAKE_SHARED_LIBRARY_SUFFIX} " zstd_BASENAME "${zstd_BASENAME} " )
43
+ set_target_properties (zstd::libzstd_shared PROPERTIES
44
+ INTERFACE_INCLUDE_DIRECTORIES "${zstd_INCLUDE_DIR} "
45
+ IMPORTED_LOCATION "${zstd_DIRNAME} /${zstd_BASENAME} "
46
+ IMPORTED_IMPLIB "${zstd_LIBRARY} " )
47
+ unset (zstd_DIRNAME )
48
+ unset (zstd_BASENAME )
49
+ else ()
50
+ set_target_properties (zstd::libzstd_shared PROPERTIES
38
51
INTERFACE_INCLUDE_DIRECTORIES "${zstd_INCLUDE_DIR} "
39
52
IMPORTED_LOCATION "${zstd_LIBRARY} " )
53
+ endif ()
40
54
else ()
41
55
set (zstd_STATIC_LIBRARY "${zstd_LIBRARY} " )
42
56
endif ()
You can’t perform that action at this time.
0 commit comments