diff --git a/liblz4_vendor/cmake/Modules/Findlz4.cmake b/liblz4_vendor/cmake/Modules/Findlz4.cmake index 59dc55d78..d39e9dd33 100644 --- a/liblz4_vendor/cmake/Modules/Findlz4.cmake +++ b/liblz4_vendor/cmake/Modules/Findlz4.cmake @@ -4,6 +4,13 @@ if(NOT lz4_ROOT_DIR AND DEFINED ENV{lz4_ROOT_DIR}) "lz4 base directory location (optional, used for nonstandard installation paths)") endif() +# When using lz4 from conda on Windows, and cmake before 3.29.0, +# we need to add the library prefix "lib" so that the library can +# be successfully found. +if(MSVC AND CMAKE_VERSION VERSION_LESS "3.29.0") + set(CMAKE_FIND_LIBRARY_PREFIXES "" "lib") +endif() + # Search path for nonstandard package locations if(lz4_ROOT_DIR) set(lz4_INCLUDE_PATH PATHS "${lz4_ROOT_DIR}/include" NO_DEFAULT_PATH)