Extract minizip as a separate external_minizip library.
This commit is contained in:
parent
b9ddf24e86
commit
8f24906ec6
3 changed files with 47 additions and 35 deletions
1
external/CMakeLists.txt
vendored
1
external/CMakeLists.txt
vendored
|
|
@ -24,6 +24,7 @@ if (add_hunspell_library)
|
||||||
endif()
|
endif()
|
||||||
add_checked_subdirectory(iconv)
|
add_checked_subdirectory(iconv)
|
||||||
add_checked_subdirectory(lz4)
|
add_checked_subdirectory(lz4)
|
||||||
|
add_checked_subdirectory(minizip)
|
||||||
add_checked_subdirectory(openal)
|
add_checked_subdirectory(openal)
|
||||||
add_checked_subdirectory(openssl)
|
add_checked_subdirectory(openssl)
|
||||||
add_checked_subdirectory(opus)
|
add_checked_subdirectory(opus)
|
||||||
|
|
|
||||||
46
external/minizip/CMakeLists.txt
vendored
Normal file
46
external/minizip/CMakeLists.txt
vendored
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
# This file is part of Desktop App Toolkit,
|
||||||
|
# a set of libraries for developing nice desktop applications.
|
||||||
|
#
|
||||||
|
# For license and copyright information please follow this link:
|
||||||
|
# https://github.com/desktop-app/legal/blob/master/LEGAL
|
||||||
|
|
||||||
|
add_library(external_minizip INTERFACE IMPORTED GLOBAL)
|
||||||
|
add_library(desktop-app::external_minizip ALIAS external_minizip)
|
||||||
|
|
||||||
|
if (DESKTOP_APP_USE_PACKAGED)
|
||||||
|
find_package(PkgConfig REQUIRED)
|
||||||
|
pkg_check_modules(MINIZIP REQUIRED minizip)
|
||||||
|
|
||||||
|
target_include_directories(external_minizip INTERFACE ${MINIZIP_INCLUDE_DIRS})
|
||||||
|
target_link_libraries(external_minizip INTERFACE ${MINIZIP_LIBRARIES})
|
||||||
|
elseif (NOT WIN32)
|
||||||
|
add_library(external_minizip_bundled STATIC)
|
||||||
|
init_target(external_minizip_bundled "(external)")
|
||||||
|
|
||||||
|
set(minizip_loc ${third_party_loc}/minizip)
|
||||||
|
|
||||||
|
target_sources(external_minizip_bundled
|
||||||
|
PRIVATE
|
||||||
|
${minizip_loc}/crypt.h
|
||||||
|
${minizip_loc}/ioapi.c
|
||||||
|
${minizip_loc}/ioapi.h
|
||||||
|
${minizip_loc}/zip.c
|
||||||
|
${minizip_loc}/zip.h
|
||||||
|
${minizip_loc}/unzip.c
|
||||||
|
${minizip_loc}/unzip.h
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(external_minizip_bundled SYSTEM
|
||||||
|
INTERFACE
|
||||||
|
${minizip_loc}
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(external_minizip INTERFACE external_minizip_bundled)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (NOT DESKTOP_APP_USE_PACKAGED AND NOT LINUX)
|
||||||
|
target_include_directories(external_minizip_bundled SYSTEM
|
||||||
|
INTERFACE
|
||||||
|
${libs_loc}/zlib/contrib/minizip
|
||||||
|
)
|
||||||
|
endif()
|
||||||
35
external/zlib/CMakeLists.txt
vendored
35
external/zlib/CMakeLists.txt
vendored
|
|
@ -7,45 +7,10 @@
|
||||||
add_library(external_zlib INTERFACE IMPORTED GLOBAL)
|
add_library(external_zlib INTERFACE IMPORTED GLOBAL)
|
||||||
add_library(desktop-app::external_zlib ALIAS external_zlib)
|
add_library(desktop-app::external_zlib ALIAS external_zlib)
|
||||||
|
|
||||||
if (DESKTOP_APP_USE_PACKAGED)
|
|
||||||
add_library(external_minizip INTERFACE IMPORTED)
|
|
||||||
find_package(PkgConfig REQUIRED)
|
|
||||||
pkg_check_modules(MINIZIP REQUIRED minizip)
|
|
||||||
|
|
||||||
target_include_directories(external_minizip INTERFACE ${MINIZIP_INCLUDE_DIRS})
|
|
||||||
target_link_libraries(external_minizip INTERFACE ${MINIZIP_LIBRARIES})
|
|
||||||
|
|
||||||
target_link_libraries(external_zlib INTERFACE external_minizip)
|
|
||||||
elseif (NOT WIN32)
|
|
||||||
add_library(external_minizip STATIC)
|
|
||||||
init_target(external_minizip "(external)")
|
|
||||||
|
|
||||||
set(minizip_loc ${third_party_loc}/minizip)
|
|
||||||
|
|
||||||
target_sources(external_minizip
|
|
||||||
PRIVATE
|
|
||||||
${minizip_loc}/crypt.h
|
|
||||||
${minizip_loc}/ioapi.c
|
|
||||||
${minizip_loc}/ioapi.h
|
|
||||||
${minizip_loc}/zip.c
|
|
||||||
${minizip_loc}/zip.h
|
|
||||||
${minizip_loc}/unzip.c
|
|
||||||
${minizip_loc}/unzip.h
|
|
||||||
)
|
|
||||||
|
|
||||||
target_include_directories(external_minizip SYSTEM
|
|
||||||
INTERFACE
|
|
||||||
${minizip_loc}
|
|
||||||
)
|
|
||||||
|
|
||||||
target_link_libraries(external_zlib INTERFACE external_minizip)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (NOT DESKTOP_APP_USE_PACKAGED AND NOT LINUX)
|
if (NOT DESKTOP_APP_USE_PACKAGED AND NOT LINUX)
|
||||||
target_include_directories(external_zlib SYSTEM
|
target_include_directories(external_zlib SYSTEM
|
||||||
INTERFACE
|
INTERFACE
|
||||||
${libs_loc}/zlib
|
${libs_loc}/zlib
|
||||||
${libs_loc}/zlib/contrib/minizip
|
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue