From 025a889f8892e3e0239c11865f53e91ae052fc51 Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Thu, 23 May 2019 15:39:43 +0200 Subject: [PATCH] Update miniz cmake --- src/miniz/CMakeLists.txt | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/miniz/CMakeLists.txt b/src/miniz/CMakeLists.txt index 512b84961..eba44a7ae 100644 --- a/src/miniz/CMakeLists.txt +++ b/src/miniz/CMakeLists.txt @@ -3,20 +3,25 @@ cmake_minimum_required(VERSION 2.6) add_library(miniz INTERFACE) -# find_package(Miniz 2.1 REQUIRED) -# if(Miniz_FOUND) +if(NOT SLIC3R_STATIC) + find_package(miniz 2.1 QUIET) +endif() -# target_link_libraries(miniz INTERFACE ${Miniz_LIBRARIES}) -# target_include_directories(miniz INTERFACE ${Miniz_INCLUDE_DIRS}) +if(miniz_FOUND) + + message(STATUS "Using system miniz...") + target_link_libraries(miniz INTERFACE miniz::miniz) -# else() +else() -add_library(miniz_static STATIC - miniz.c - miniz.h -) + add_library(miniz_static STATIC + miniz.c + miniz.h + ) + + target_link_libraries(miniz INTERFACE miniz_static) + target_include_directories(miniz INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) + + message(STATUS "Miniz NOT found in system, using bundled version...") -target_link_libraries(miniz INTERFACE miniz_static) -target_include_directories(miniz INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) - -# endif() +endif()