2020-11-16 14:47:43 +08:00
|
|
|
|
|
|
|
set(lib_name zlib)
|
2022-02-17 17:11:17 +08:00
|
|
|
set(target_name dep_${lib_name})
|
2020-11-16 14:47:43 +08:00
|
|
|
|
|
|
|
project(${lib_name})
|
|
|
|
|
2023-03-11 22:10:18 +08:00
|
|
|
include(AXPlatform)
|
2020-11-16 14:47:43 +08:00
|
|
|
|
|
|
|
if(WINDOWS)
|
|
|
|
add_library(${target_name} SHARED IMPORTED GLOBAL)
|
|
|
|
else()
|
|
|
|
add_library(${target_name} STATIC IMPORTED GLOBAL)
|
|
|
|
endif()
|
|
|
|
|
2021-04-28 12:43:51 +08:00
|
|
|
set(ZLIB_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include" CACHE STRING "zlib include dir" FORCE)
|
|
|
|
|
2022-05-14 17:47:47 +08:00
|
|
|
if(NOT WINDOWS)
|
2021-04-28 12:43:51 +08:00
|
|
|
set(ZLIB_LIBRARY "${platform_spec_path}/libz.a" CACHE STRING "zlib library" FORCE)
|
2020-11-16 14:47:43 +08:00
|
|
|
set_target_properties(${target_name} PROPERTIES
|
|
|
|
IMPORTED_LOCATION "${platform_spec_path}/libz.a"
|
|
|
|
)
|
2022-05-14 17:47:47 +08:00
|
|
|
else()
|
2022-04-21 17:05:23 +08:00
|
|
|
set(ZLIB_LIBRARY "${platform_spec_path}/zlib.lib" CACHE STRING "zlib library" FORCE)
|
2020-11-16 14:47:43 +08:00
|
|
|
set_target_properties(${target_name} PROPERTIES
|
|
|
|
IMPORTED_LOCATION "${platform_spec_path}/zlib1.dll"
|
2022-04-21 17:05:23 +08:00
|
|
|
IMPORTED_IMPLIB "${platform_spec_path}/zlib.lib"
|
2020-11-16 14:47:43 +08:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set_target_properties(${target_name} PROPERTIES
|
|
|
|
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/include"
|
|
|
|
)
|