PrusaSlicer-NonPlainar/src/miniz/CMakeLists.txt

32 lines
746 B
CMake
Raw Normal View History

cmake_minimum_required(VERSION 2.8.12)
project(miniz)
add_library(miniz INTERFACE)
if(NOT SLIC3R_STATIC OR CMAKE_SYSTEM_NAME STREQUAL "Linux")
2019-05-23 13:39:43 +00:00
find_package(miniz 2.1 QUIET)
endif()
2019-05-23 13:39:43 +00:00
if(miniz_FOUND)
message(STATUS "Using system miniz...")
target_link_libraries(miniz INTERFACE miniz::miniz)
2019-05-23 13:39:43 +00:00
else()
2019-05-23 13:39:43 +00:00
add_library(miniz_static STATIC
miniz.c
miniz.h
)
2019-05-31 14:57:27 +00:00
if(${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
target_compile_definitions(miniz_static PRIVATE _GNU_SOURCE)
endif()
2019-05-23 13:39:43 +00:00
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...")
2019-05-23 13:39:43 +00:00
endif()