diff --git a/CMakeLists.txt b/CMakeLists.txt index 02d6916d86fc..a46169b43cfb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -582,8 +582,14 @@ else() add_subdirectory(Externals/zlib) endif() -add_subdirectory(Externals/minizip) -include_directories(External/minizip) +pkg_check_modules(MINIZIP minizip) +if(MINIZIP_FOUND) + message(STATUS "Using shared minizip") +else() + message(STATUS "Shared minizip not found, falling back to the static library") + add_subdirectory(Externals/minizip) + include_directories(External/minizip) +endif() if(NOT APPLE) check_lib(LZO "(no .pc for lzo2)" lzo2 lzo/lzo1x.h QUIET)