mirror of
https://github.com/madler/zlib
synced 2025-03-28 21:13:15 +00:00
CMake: Add cmake-format.yaml and reformat the cmake files.
This commit is contained in:
parent
4f2671d50c
commit
8b8a124eb4
245
.cmake-format.yaml
Normal file
245
.cmake-format.yaml
Normal file
@ -0,0 +1,245 @@
|
||||
_help_parse: Options affecting listfile parsing
|
||||
parse:
|
||||
_help_additional_commands:
|
||||
- Specify structure for custom cmake functions
|
||||
additional_commands:
|
||||
foo:
|
||||
flags:
|
||||
- BAR
|
||||
- BAZ
|
||||
kwargs:
|
||||
HEADERS: '*'
|
||||
SOURCES: '*'
|
||||
DEPENDS: '*'
|
||||
_help_override_spec:
|
||||
- Override configurations per-command where available
|
||||
override_spec: {}
|
||||
_help_vartags:
|
||||
- Specify variable tags.
|
||||
vartags: []
|
||||
_help_proptags:
|
||||
- Specify property tags.
|
||||
proptags: []
|
||||
_help_format: Options affecting formatting.
|
||||
format:
|
||||
_help_disable:
|
||||
- Disable formatting entirely, making cmake-format a no-op
|
||||
disable: false
|
||||
_help_line_width:
|
||||
- How wide to allow formatted cmake files
|
||||
line_width: 80
|
||||
_help_tab_size:
|
||||
- How many spaces to tab for indent
|
||||
tab_size: 4
|
||||
_help_use_tabchars:
|
||||
- If true, lines are indented using tab characters (utf-8
|
||||
- 0x09) instead of <tab_size> space characters (utf-8 0x20).
|
||||
- In cases where the layout would require a fractional tab
|
||||
- character, the behavior of the fractional indentation is
|
||||
- governed by <fractional_tab_policy>
|
||||
use_tabchars: false
|
||||
_help_fractional_tab_policy:
|
||||
- If <use_tabchars> is True, then the value of this variable
|
||||
- indicates how fractional indentions are handled during
|
||||
- whitespace replacement. If set to 'use-space', fractional
|
||||
- indentation is left as spaces (utf-8 0x20). If set to
|
||||
- '`round-up` fractional indentation is replaced with a single'
|
||||
- tab character (utf-8 0x09) effectively shifting the column
|
||||
- to the next tabstop
|
||||
fractional_tab_policy: use-space
|
||||
_help_max_subgroups_hwrap:
|
||||
- If an argument group contains more than this many sub-groups
|
||||
- (parg or kwarg groups) then force it to a vertical layout.
|
||||
max_subgroups_hwrap: 2
|
||||
_help_max_pargs_hwrap:
|
||||
- If a positional argument group contains more than this many
|
||||
- arguments, then force it to a vertical layout.
|
||||
max_pargs_hwrap: 6
|
||||
_help_max_rows_cmdline:
|
||||
- If a cmdline positional group consumes more than this many
|
||||
- lines without nesting, then invalidate the layout (and nest)
|
||||
max_rows_cmdline: 2
|
||||
_help_separate_ctrl_name_with_space:
|
||||
- If true, separate flow control names from their parentheses
|
||||
- with a space
|
||||
separate_ctrl_name_with_space: false
|
||||
_help_separate_fn_name_with_space:
|
||||
- If true, separate function names from parentheses with a
|
||||
- space
|
||||
separate_fn_name_with_space: false
|
||||
_help_dangle_parens:
|
||||
- If a statement is wrapped to more than one line, than dangle
|
||||
- the closing parenthesis on its own line.
|
||||
dangle_parens: false
|
||||
_help_dangle_align:
|
||||
- If the trailing parenthesis must be 'dangled' on its on
|
||||
- 'line, then align it to this reference: `prefix`: the start'
|
||||
- 'of the statement, `prefix-indent`: the start of the'
|
||||
- 'statement, plus one indentation level, `child`: align to'
|
||||
- the column of the arguments
|
||||
dangle_align: prefix
|
||||
_help_min_prefix_chars:
|
||||
- If the statement spelling length (including space and
|
||||
- parenthesis) is smaller than this amount, then force reject
|
||||
- nested layouts.
|
||||
min_prefix_chars: 4
|
||||
_help_max_prefix_chars:
|
||||
- If the statement spelling length (including space and
|
||||
- parenthesis) is larger than the tab width by more than this
|
||||
- amount, then force reject un-nested layouts.
|
||||
max_prefix_chars: 10
|
||||
_help_max_lines_hwrap:
|
||||
- If a candidate layout is wrapped horizontally but it exceeds
|
||||
- this many lines, then reject the layout.
|
||||
max_lines_hwrap: 2
|
||||
_help_line_ending:
|
||||
- What style line endings to use in the output.
|
||||
line_ending: unix
|
||||
_help_command_case:
|
||||
- Format command names consistently as 'lower' or 'upper' case
|
||||
command_case: canonical
|
||||
_help_keyword_case:
|
||||
- Format keywords consistently as 'lower' or 'upper' case
|
||||
keyword_case: unchanged
|
||||
_help_always_wrap:
|
||||
- A list of command names which should always be wrapped
|
||||
always_wrap: []
|
||||
_help_enable_sort:
|
||||
- If true, the argument lists which are known to be sortable
|
||||
- will be sorted lexicographicall
|
||||
enable_sort: true
|
||||
_help_autosort:
|
||||
- If true, the parsers may infer whether or not an argument
|
||||
- list is sortable (without annotation).
|
||||
autosort: false
|
||||
_help_require_valid_layout:
|
||||
- By default, if cmake-format cannot successfully fit
|
||||
- everything into the desired linewidth it will apply the
|
||||
- last, most aggressive attempt that it made. If this flag is
|
||||
- True, however, cmake-format will print error, exit with non-
|
||||
- zero status code, and write-out nothing
|
||||
require_valid_layout: false
|
||||
_help_layout_passes:
|
||||
- A dictionary mapping layout nodes to a list of wrap
|
||||
- decisions. See the documentation for more information.
|
||||
layout_passes: {}
|
||||
_help_markup: Options affecting comment reflow and formatting.
|
||||
markup:
|
||||
_help_bullet_char:
|
||||
- What character to use for bulleted lists
|
||||
bullet_char: '*'
|
||||
_help_enum_char:
|
||||
- What character to use as punctuation after numerals in an
|
||||
- enumerated list
|
||||
enum_char: .
|
||||
_help_first_comment_is_literal:
|
||||
- If comment markup is enabled, don't reflow the first comment
|
||||
- block in each listfile. Use this to preserve formatting of
|
||||
- your copyright/license statements.
|
||||
first_comment_is_literal: false
|
||||
_help_literal_comment_pattern:
|
||||
- If comment markup is enabled, don't reflow any comment block
|
||||
- which matches this (regex) pattern. Default is `None`
|
||||
- (disabled).
|
||||
literal_comment_pattern: null
|
||||
_help_fence_pattern:
|
||||
- Regular expression to match preformat fences in comments
|
||||
- default= ``r'^\s*([`~]{3}[`~]*)(.*)$'``
|
||||
fence_pattern: ^\s*([`~]{3}[`~]*)(.*)$
|
||||
_help_ruler_pattern:
|
||||
- Regular expression to match rulers in comments default=
|
||||
- '``r''^\s*[^\w\s]{3}.*[^\w\s]{3}$''``'
|
||||
ruler_pattern: ^\s*[^\w\s]{3}.*[^\w\s]{3}$
|
||||
_help_explicit_trailing_pattern:
|
||||
- If a comment line matches starts with this pattern then it
|
||||
- is explicitly a trailing comment for the preceding argument.
|
||||
- Default is '#<'
|
||||
explicit_trailing_pattern: '#<'
|
||||
_help_hashruler_min_length:
|
||||
- If a comment line starts with at least this many consecutive
|
||||
- hash characters, then don't lstrip() them off. This allows
|
||||
- for lazy hash rulers where the first hash char is not
|
||||
- separated by space
|
||||
hashruler_min_length: 10
|
||||
_help_canonicalize_hashrulers:
|
||||
- If true, then insert a space between the first hash char and
|
||||
- remaining hash chars in a hash ruler, and normalize its
|
||||
- length to fill the column
|
||||
canonicalize_hashrulers: true
|
||||
_help_enable_markup:
|
||||
- enable comment markup parsing and reflow
|
||||
enable_markup: true
|
||||
_help_lint: Options affecting the linter
|
||||
lint:
|
||||
_help_disabled_codes:
|
||||
- a list of lint codes to disable
|
||||
disabled_codes: []
|
||||
_help_function_pattern:
|
||||
- regular expression pattern describing valid function names
|
||||
function_pattern: '[0-9a-z_]+'
|
||||
_help_macro_pattern:
|
||||
- regular expression pattern describing valid macro names
|
||||
macro_pattern: '[0-9A-Z_]+'
|
||||
_help_global_var_pattern:
|
||||
- regular expression pattern describing valid names for
|
||||
- variables with global (cache) scope
|
||||
global_var_pattern: '[A-Z][0-9A-Z_]+'
|
||||
_help_internal_var_pattern:
|
||||
- regular expression pattern describing valid names for
|
||||
- variables with global scope (but internal semantic)
|
||||
internal_var_pattern: _[A-Z][0-9A-Z_]+
|
||||
_help_local_var_pattern:
|
||||
- regular expression pattern describing valid names for
|
||||
- variables with local scope
|
||||
local_var_pattern: '[a-z][a-z0-9_]+'
|
||||
_help_private_var_pattern:
|
||||
- regular expression pattern describing valid names for
|
||||
- privatedirectory variables
|
||||
private_var_pattern: _[0-9a-z_]+
|
||||
_help_public_var_pattern:
|
||||
- regular expression pattern describing valid names for public
|
||||
- directory variables
|
||||
public_var_pattern: '[A-Z][0-9A-Z_]+'
|
||||
_help_argument_var_pattern:
|
||||
- regular expression pattern describing valid names for
|
||||
- function/macro arguments and loop variables.
|
||||
argument_var_pattern: '[a-z][a-z0-9_]+'
|
||||
_help_keyword_pattern:
|
||||
- regular expression pattern describing valid names for
|
||||
- keywords used in functions or macros
|
||||
keyword_pattern: '[A-Z][0-9A-Z_]+'
|
||||
_help_max_conditionals_custom_parser:
|
||||
- In the heuristic for C0201, how many conditionals to match
|
||||
- within a loop in before considering the loop a parser.
|
||||
max_conditionals_custom_parser: 2
|
||||
_help_min_statement_spacing:
|
||||
- Require at least this many newlines between statements
|
||||
min_statement_spacing: 1
|
||||
_help_max_statement_spacing:
|
||||
- Require no more than this many newlines between statements
|
||||
max_statement_spacing: 2
|
||||
max_returns: 6
|
||||
max_branches: 12
|
||||
max_arguments: 5
|
||||
max_localvars: 15
|
||||
max_statements: 50
|
||||
_help_encode: Options affecting file encoding
|
||||
encode:
|
||||
_help_emit_byteorder_mark:
|
||||
- If true, emit the unicode byte-order mark (BOM) at the start
|
||||
- of the file
|
||||
emit_byteorder_mark: false
|
||||
_help_input_encoding:
|
||||
- Specify the encoding of the input file. Defaults to utf-8
|
||||
input_encoding: utf-8
|
||||
_help_output_encoding:
|
||||
- Specify the encoding of the output file. Defaults to utf-8.
|
||||
- Note that cmake only claims to support utf-8 so be careful
|
||||
- when using anything else
|
||||
output_encoding: utf-8
|
||||
_help_misc: Miscellaneous configurations options.
|
||||
misc:
|
||||
_help_per_command:
|
||||
- A dictionary containing any per-command configuration
|
||||
- overrides. Currently only `command_case` is supported.
|
||||
per_command: {}
|
154
CMakeLists.txt
154
CMakeLists.txt
@ -1,30 +1,30 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(zlib
|
||||
project(
|
||||
zlib
|
||||
LANGUAGES C
|
||||
VERSION 1.3.1.1
|
||||
VERSION 1.4.1.1
|
||||
HOMEPAGE_URL "https://zlib.net/"
|
||||
DESCRIPTION "a general-purpose lossless data-compression library")
|
||||
|
||||
#============================================================================
|
||||
# ============================================================================
|
||||
# CPack
|
||||
#============================================================================
|
||||
# ============================================================================
|
||||
set(CPACK_PACKAGE_VENDOR "zlib-Project")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_FILE ${zlib_SOURCE_DIR}/README)
|
||||
set(CPACK_RESOURCE_FILE_LICENSE ${zlib_SOURCE_DIR}/LICENSE)
|
||||
set(CPACK_RESOURCE_FILE_README ${zlib_SOURCE_DIR}/README)
|
||||
|
||||
#============================================================================
|
||||
# ============================================================================
|
||||
# configuration
|
||||
#============================================================================
|
||||
# ============================================================================
|
||||
|
||||
option(ZLIB_BUILD_TESTING "Enable Zlib Examples as tests" ON)
|
||||
option(ZLIB_BUILD_SHARED "Enable building zlib shared library" ON)
|
||||
option(ZLIB_BUILD_STATIC "Enable building zlib static library" ON)
|
||||
option(ZLIB_BUILD_MINIZIP "Enable building libminizip contrib library" OFF)
|
||||
option(ZLIB_INSTALL "Enable installation of zlib" ON)
|
||||
option(ZLIB_PREFIX
|
||||
"prefix for all types and library functions, see zconf.h.in"
|
||||
option(ZLIB_PREFIX "prefix for all types and library functions, see zconf.h.in"
|
||||
OFF)
|
||||
mark_as_advanced(ZLIB_PREFIX)
|
||||
|
||||
@ -70,7 +70,9 @@ if(NOT ZLIB_CONF_WRITTEN)
|
||||
endforeach(item IN LISTS ${ZCONF_CONTENT})
|
||||
|
||||
file(APPEND ${CONF_OUT_FILE} ${OUT_CONTENT})
|
||||
set(ZLIB_CONF_WRITTEN TRUE CACHE BOOL "zconf.h.cmakein was created")
|
||||
set(ZLIB_CONF_WRITTEN
|
||||
TRUE
|
||||
CACHE BOOL "zconf.h.cmakein was created")
|
||||
mark_as_advanced(ZLIB_CONF_WRITTEN)
|
||||
endif(NOT ZLIB_CONF_WRITTEN)
|
||||
|
||||
@ -115,19 +117,15 @@ check_c_source_compiles(
|
||||
|
||||
unset(CMAKE_COMPILE_FLAGS)
|
||||
set(ZLIB_PC ${zlib_BINARY_DIR}/zlib.pc)
|
||||
configure_file(${zlib_SOURCE_DIR}/zlib.pc.cmakein
|
||||
${ZLIB_PC} @ONLY)
|
||||
configure_file(${zlib_BINARY_DIR}/zconf.h.cmakein
|
||||
${zlib_BINARY_DIR}/zconf.h)
|
||||
configure_file(${zlib_SOURCE_DIR}/zlib.pc.cmakein ${ZLIB_PC} @ONLY)
|
||||
configure_file(${zlib_BINARY_DIR}/zconf.h.cmakein ${zlib_BINARY_DIR}/zconf.h)
|
||||
include_directories(${zlib_BINARY_DIR} ${zlib_SOURCE_DIR})
|
||||
|
||||
#============================================================================
|
||||
# ============================================================================
|
||||
# zlib
|
||||
#============================================================================
|
||||
# ============================================================================
|
||||
|
||||
set(ZLIB_PUBLIC_HDRS
|
||||
${zlib_BINARY_DIR}/zconf.h
|
||||
zlib.h)
|
||||
set(ZLIB_PUBLIC_HDRS ${zlib_BINARY_DIR}/zconf.h zlib.h)
|
||||
|
||||
set(ZLIB_PRIVATE_HDRS
|
||||
crc32.h
|
||||
@ -157,8 +155,10 @@ set(ZLIB_SRCS
|
||||
uncompr.c
|
||||
zutil.c)
|
||||
|
||||
set_source_files_properties(win32/zlib1.rc PROPERTIES
|
||||
COMPILE_FLAGS $<$<STREQUAL:${CMAKE_RC_OUTPUT_EXTENSION},.obj>:-DGCC_WINDRES>)
|
||||
set_source_files_properties(
|
||||
win32/zlib1.rc
|
||||
PROPERTIES COMPILE_FLAGS
|
||||
$<$<STREQUAL:${CMAKE_RC_OUTPUT_EXTENSION},.obj>:-DGCC_WINDRES>)
|
||||
|
||||
if(WIN32)
|
||||
set(zlib_static_suffix "s")
|
||||
@ -166,116 +166,126 @@ if(WIN32)
|
||||
endif(WIN32)
|
||||
|
||||
if(ZLIB_BUILD_SHARED)
|
||||
add_library(zlib SHARED
|
||||
${ZLIB_SRCS}
|
||||
${ZLIB_PUBLIC_HDRS}
|
||||
${ZLIB_PRIVATE_HDRS}
|
||||
add_library(
|
||||
zlib SHARED ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}
|
||||
$<$<OR:$<BOOL:${WIN32}>,$<BOOL:${CYGWIN}>>:win32/zlib1.rc>)
|
||||
add_library(ZLIB::ZLIB ALIAS zlib)
|
||||
target_include_directories(zlib PUBLIC
|
||||
$<BUILD_INTERFACE:${zlib_BINARY_DIR}>
|
||||
target_include_directories(
|
||||
zlib
|
||||
PUBLIC $<BUILD_INTERFACE:${zlib_BINARY_DIR}>
|
||||
$<BUILD_INTERFACE:${zlib_SOURCE_DIR}>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
|
||||
target_compile_definitions(zlib
|
||||
PRIVATE
|
||||
$<$<BOOL:NOT:${HAVE_FSEEKO}>:NO_FSEEKO>
|
||||
target_compile_definitions(
|
||||
zlib
|
||||
PRIVATE $<$<BOOL:NOT:${HAVE_FSEEKO}>:NO_FSEEKO>
|
||||
$<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>
|
||||
$<$<BOOL:${MSVC}>:_CRT_SECURE_NO_DEPRECATE>
|
||||
$<$<BOOL:${MSVC}>:_CRT_NONSTDC_NO_DEPRECATE>
|
||||
PUBLIC
|
||||
$<$<BOOL:${HAVE_OFF64_T}>:_LARGEFILE64_SOURCE=1>)
|
||||
PUBLIC $<$<BOOL:${HAVE_OFF64_T}>:_LARGEFILE64_SOURCE=1>)
|
||||
set(INSTALL_VERSION ${zlib_VERSION})
|
||||
|
||||
if(NOT CYGWIN)
|
||||
set_target_properties(zlib PROPERTIES
|
||||
SOVERSION ${zlib_VERSION_MAJOR}
|
||||
set_target_properties(zlib PROPERTIES SOVERSION ${zlib_VERSION_MAJOR}
|
||||
VERSION ${INSTALL_VERSION})
|
||||
endif(NOT CYGWIN)
|
||||
|
||||
set_target_properties(zlib PROPERTIES
|
||||
DEFINE_SYMBOL ZLIB_DLL
|
||||
set_target_properties(
|
||||
zlib
|
||||
PROPERTIES DEFINE_SYMBOL ZLIB_DLL
|
||||
EXPORT_NAME ZLIB
|
||||
OUTPUT_NAME z)
|
||||
if(UNIX AND NOT APPLE AND NOT(CMAKE_SYSTEM_NAME STREQUAL AIX))
|
||||
if(UNIX
|
||||
AND NOT APPLE
|
||||
AND NOT (CMAKE_SYSTEM_NAME STREQUAL AIX))
|
||||
# On unix-like platforms the library is almost always called libz
|
||||
set_target_properties(zlib PROPERTIES
|
||||
LINK_FLAGS "-Wl,--version-script,\"${zlib_SOURCE_DIR}/zlib.map\"")
|
||||
endif(UNIX AND NOT APPLE AND NOT(CMAKE_SYSTEM_NAME STREQUAL AIX))
|
||||
set_target_properties(
|
||||
zlib
|
||||
PROPERTIES LINK_FLAGS
|
||||
"-Wl,--version-script,\"${zlib_SOURCE_DIR}/zlib.map\"")
|
||||
endif(
|
||||
UNIX
|
||||
AND NOT APPLE
|
||||
AND NOT (CMAKE_SYSTEM_NAME STREQUAL AIX))
|
||||
endif(ZLIB_BUILD_SHARED)
|
||||
|
||||
if(ZLIB_BUILD_STATIC)
|
||||
add_library(zlibstatic STATIC
|
||||
${ZLIB_SRCS}
|
||||
${ZLIB_PUBLIC_HDRS}
|
||||
add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS}
|
||||
${ZLIB_PRIVATE_HDRS})
|
||||
add_library(ZLIB::ZLIBSTATIC ALIAS zlibstatic)
|
||||
target_include_directories(zlibstatic PUBLIC
|
||||
$<BUILD_INTERFACE:${zlib_BINARY_DIR}>
|
||||
target_include_directories(
|
||||
zlibstatic
|
||||
PUBLIC $<BUILD_INTERFACE:${zlib_BINARY_DIR}>
|
||||
$<BUILD_INTERFACE:${zlib_SOURCE_DIR}>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
|
||||
target_compile_definitions(zlibstatic
|
||||
PRIVATE
|
||||
$<$<BOOL:NOT:${HAVE_FSEEKO}>:NO_FSEEKO>
|
||||
target_compile_definitions(
|
||||
zlibstatic
|
||||
PRIVATE $<$<BOOL:NOT:${HAVE_FSEEKO}>:NO_FSEEKO>
|
||||
$<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>
|
||||
$<$<BOOL:${MSVC}>:_CRT_SECURE_NO_DEPRECATE>
|
||||
$<$<BOOL:${MSVC}>:_CRT_NONSTDC_NO_DEPRECATE>
|
||||
PUBLIC
|
||||
$<$<BOOL:${HAVE_OFF64_T}>:_LARGEFILE64_SOURCE=1>)
|
||||
set_target_properties(zlibstatic PROPERTIES
|
||||
EXPORT_NAME ZLIBSTATIC
|
||||
OUTPUT_NAME z${zlib_static_suffix})
|
||||
PUBLIC $<$<BOOL:${HAVE_OFF64_T}>:_LARGEFILE64_SOURCE=1>)
|
||||
set_target_properties(
|
||||
zlibstatic PROPERTIES EXPORT_NAME ZLIBSTATIC OUTPUT_NAME
|
||||
z${zlib_static_suffix})
|
||||
endif(ZLIB_BUILD_STATIC)
|
||||
|
||||
if(ZLIB_INSTALL)
|
||||
if(ZLIB_BUILD_SHARED)
|
||||
install(TARGETS zlib
|
||||
install(
|
||||
TARGETS zlib
|
||||
COMPONENT Runtime
|
||||
EXPORT zlibSharedExport
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
install(EXPORT zlibSharedExport
|
||||
install(
|
||||
EXPORT zlibSharedExport
|
||||
FILE ZLIB-shared.cmake
|
||||
NAMESPACE ZLIB::
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/zlib)
|
||||
if(ZLIB_INSTALL_COMPAT_DLL)
|
||||
install(FILES $<TARGET_FILE:zlib>
|
||||
install(
|
||||
FILES $<TARGET_FILE:zlib>
|
||||
COMPONENT Runtime
|
||||
RENAME zlib1.dll
|
||||
DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||
endif(ZLIB_INSTALL_COMPAT_DLL)
|
||||
|
||||
if(MSVC)
|
||||
install(FILES $<TARGET_PDB_FILE:zlib>
|
||||
install(
|
||||
FILES $<TARGET_PDB_FILE:zlib>
|
||||
COMPONENT Runtime
|
||||
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
CONFIGURATIONS Debug OR RelWithDebInfo
|
||||
OPTIONAL
|
||||
)
|
||||
OPTIONAL)
|
||||
endif(MSVC)
|
||||
endif(ZLIB_BUILD_SHARED)
|
||||
|
||||
if(ZLIB_BUILD_STATIC)
|
||||
install(TARGETS zlibstatic
|
||||
install(
|
||||
TARGETS zlibstatic
|
||||
COMPONENT Development
|
||||
EXPORT zlibStaticExport
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
install(EXPORT zlibStaticExport
|
||||
install(
|
||||
EXPORT zlibStaticExport
|
||||
FILE ZLIB-static.cmake
|
||||
NAMESPACE ZLIB::
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/zlib)
|
||||
|
||||
if(ZLIB_INSTALL_COMPAT_DLL AND MINGW)
|
||||
install(FILES $<TARGET_FILE:zlibstatic>
|
||||
install(
|
||||
FILES $<TARGET_FILE:zlibstatic>
|
||||
COMPONENT Development
|
||||
RENAME libz.dll.a
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
endif(ZLIB_INSTALL_COMPAT_DLL AND MINGW)
|
||||
endif(ZLIB_BUILD_STATIC)
|
||||
|
||||
configure_package_config_file(${zlib_SOURCE_DIR}/zlibConfig.cmake.in
|
||||
configure_package_config_file(
|
||||
${zlib_SOURCE_DIR}/zlibConfig.cmake.in
|
||||
${zlib_BINARY_DIR}/ZLIBConfig.cmake
|
||||
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/zlib)
|
||||
|
||||
@ -284,18 +294,19 @@ if(ZLIB_INSTALL)
|
||||
VERSION "${zlib_VERSION}"
|
||||
COMPATIBILITY AnyNewerVersion)
|
||||
|
||||
install(FILES
|
||||
${zlib_BINARY_DIR}/ZLIBConfig.cmake
|
||||
install(FILES ${zlib_BINARY_DIR}/ZLIBConfig.cmake
|
||||
${zlib_BINARY_DIR}/ZLIBConfigVersion.cmake
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/zlib)
|
||||
install(FILES ${ZLIB_PUBLIC_HDRS}
|
||||
install(
|
||||
FILES ${ZLIB_PUBLIC_HDRS}
|
||||
COMPONENT Development
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
install(FILES zlib.3
|
||||
install(
|
||||
FILES zlib.3
|
||||
COMPONENT Docs
|
||||
DESTINATION "${CMAKE_INSTALL_MANDIR}/man3")
|
||||
install(FILES
|
||||
LICENSE
|
||||
install(
|
||||
FILES LICENSE
|
||||
doc/algorithm.txt
|
||||
doc/crc-doc.1.0.pdf
|
||||
doc/rfc1950.txt
|
||||
@ -304,14 +315,15 @@ if(ZLIB_INSTALL)
|
||||
doc/txtvsbin.txt
|
||||
COMPONENT Docs
|
||||
DESTINATION "${CMAKE_INSTALL_DOCDIR}/zlib")
|
||||
install(FILES ${ZLIB_PC}
|
||||
install(
|
||||
FILES ${ZLIB_PC}
|
||||
COMPONENT Development
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
||||
endif(ZLIB_INSTALL)
|
||||
|
||||
#============================================================================
|
||||
# ============================================================================
|
||||
# Tests
|
||||
#============================================================================
|
||||
# ============================================================================
|
||||
if(ZLIB_BUILD_TESTING)
|
||||
enable_testing()
|
||||
add_subdirectory(test)
|
||||
|
@ -1,6 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(minizip
|
||||
project(
|
||||
minizip
|
||||
VERSION 1.0.0
|
||||
LANGUAGES C
|
||||
DESCRIPTION "A library for creating zipfiles based in zlib"
|
||||
@ -11,17 +12,17 @@ if(CMAKE_SIZEOF_VOID_P LESS 8 AND NOT MINGW)
|
||||
return()
|
||||
endif(CMAKE_SIZEOF_VOID_P LESS 8 AND NOT MINGW)
|
||||
|
||||
#============================================================================
|
||||
# ============================================================================
|
||||
# CPack
|
||||
#============================================================================
|
||||
# ============================================================================
|
||||
set(CPACK_PACKAGE_VENDOR "zlib-Project")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_FILE ${minizip_SOURCE_DIR}/MiniZip64_info.txt)
|
||||
set(CPACK_RESOURCE_FILE_LICENSE ${minizip_SOURCE_DIR}/../../LICENSE)
|
||||
set(CPACK_RESOURCE_FILE_README ${minizip_SOURCE_DIR}/MiniZip64_info.txt)
|
||||
|
||||
#============================================================================
|
||||
# ============================================================================
|
||||
# configuration
|
||||
#============================================================================
|
||||
# ============================================================================
|
||||
option(MINIZIP_BUILD_SHARED "Enable building minizip shared library" ON)
|
||||
option(MINIZIP_BUILD_STATIC "Enable building minizip static library" ON)
|
||||
option(MINIZIP_BUILD_TESTING "Enable testing of minizip" ON)
|
||||
@ -92,39 +93,16 @@ if(NOT TARGET ZLIB::ZLIB)
|
||||
find_package(ZLIB REQUIRED CONFIG)
|
||||
endif(NOT TARGET ZLIB::ZLIB)
|
||||
|
||||
set(LIBMINIZIP_SRCS
|
||||
ioapi.c
|
||||
mztools.c
|
||||
unzip.c
|
||||
zip.c)
|
||||
set(LIBMINIZIP_SRCS ioapi.c mztools.c unzip.c zip.c)
|
||||
|
||||
set(LIBMINIZIP_HDRS
|
||||
crypt.h
|
||||
ints.h
|
||||
ioapi.h
|
||||
mztools.h
|
||||
unzip.h
|
||||
set(LIBMINIZIP_HDRS crypt.h ints.h ioapi.h mztools.h unzip.h zip.h)
|
||||
|
||||
set(MINIZIP_SRCS ioapi.c $<$<BOOL:${WIN32}>:iowin32.c> minizip.c zip.c)
|
||||
|
||||
set(MINIZIP_HDRS crypt.h ints.h ioapi.h $<$<BOOL:${WIN32}>:iowin32.h> skipset.h
|
||||
zip.h)
|
||||
|
||||
set(MINIZIP_SRCS
|
||||
ioapi.c
|
||||
$<$<BOOL:${WIN32}>:iowin32.c>
|
||||
minizip.c
|
||||
zip.c)
|
||||
|
||||
set(MINIZIP_HDRS
|
||||
crypt.h
|
||||
ints.h
|
||||
ioapi.h
|
||||
$<$<BOOL:${WIN32}>:iowin32.h>
|
||||
skipset.h
|
||||
zip.h)
|
||||
|
||||
set(MINIUNZIP_SRCS
|
||||
ioapi.c
|
||||
$<$<BOOL:${WIN32}>:iowin32.c>
|
||||
miniunz.c
|
||||
unzip.c
|
||||
set(MINIUNZIP_SRCS ioapi.c $<$<BOOL:${WIN32}>:iowin32.c> miniunz.c unzip.c
|
||||
zip.c)
|
||||
|
||||
set(MINIUNZIP_HDRS
|
||||
@ -143,137 +121,122 @@ endif(WIN32)
|
||||
|
||||
if(MINIZIP_BUILD_SHARED)
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
|
||||
add_library(libminizip SHARED
|
||||
${LIBMINIZIP_SRCS}
|
||||
${LIBMINIZIP_HDRS})
|
||||
add_library(libminizip SHARED ${LIBMINIZIP_SRCS} ${LIBMINIZIP_HDRS})
|
||||
add_library(MINIZIP::minizip ALIAS libminizip)
|
||||
target_include_directories(libminizip PUBLIC
|
||||
$<BUILD_INTERFACE:${minizip_SOURCE_DIR}>
|
||||
target_include_directories(
|
||||
libminizip PUBLIC $<BUILD_INTERFACE:${minizip_SOURCE_DIR}>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
|
||||
target_compile_definitions(libminizip
|
||||
PRIVATE
|
||||
$<$<BOOL:${MSVC}>:_CRT_SECURE_NO_WARNINGS>
|
||||
target_compile_definitions(
|
||||
libminizip
|
||||
PRIVATE $<$<BOOL:${MSVC}>:_CRT_SECURE_NO_WARNINGS>
|
||||
$<$<BOOL:${BZIP2_FOUND}>:HAVE_BZIP2=1>
|
||||
$<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>
|
||||
$<$<BOOL:${HAVE_UNISTD_H}>:HAVE_UNISTD_H=1>
|
||||
$<$<BOOL:NOT:${HAVE_FOPEN64}>:USE_FILE32API=1>
|
||||
PUBLIC
|
||||
$<$<BOOL:${HAVE_OFF64_T}>:_LARGEFILE64_SOURCE=1>)
|
||||
PUBLIC $<$<BOOL:${HAVE_OFF64_T}>:_LARGEFILE64_SOURCE=1>)
|
||||
|
||||
if(NOT CYGWIN)
|
||||
set_target_properties(libminizip PROPERTIES
|
||||
SOVERSION ${minizip_VERSION_MAJOR})
|
||||
set_target_properties(libminizip PROPERTIES SOVERSION
|
||||
${minizip_VERSION_MAJOR})
|
||||
endif(NOT CYGWIN)
|
||||
|
||||
set_target_properties(libminizip PROPERTIES
|
||||
EXPORT_NAME minizip
|
||||
set_target_properties(
|
||||
libminizip
|
||||
PROPERTIES EXPORT_NAME minizip
|
||||
OUTPUT_NAME minizip
|
||||
VERSIOM ${minizip_VERSION}
|
||||
SOVERSION ${minizip_VERSION_MAJOR})
|
||||
target_link_libraries(libminizip PUBLIC ZLIB::ZLIB)
|
||||
|
||||
add_executable(minizip
|
||||
${MINIZIP_SRCS}
|
||||
${MINIZIP_HDRS})
|
||||
set_target_properties(minizip PROPERTIES
|
||||
EXPORT_NAME minizip_executable)
|
||||
target_compile_definitions(minizip
|
||||
PRIVATE
|
||||
$<$<BOOL:${MSVC}>:_CRT_SECURE_NO_WARNINGS>
|
||||
add_executable(minizip ${MINIZIP_SRCS} ${MINIZIP_HDRS})
|
||||
set_target_properties(minizip PROPERTIES EXPORT_NAME minizip_executable)
|
||||
target_compile_definitions(
|
||||
minizip PRIVATE $<$<BOOL:${MSVC}>:_CRT_SECURE_NO_WARNINGS>
|
||||
$<$<BOOL:NOT:${HAVE_FOPEN64}>:USE_FILE32API=1>)
|
||||
target_link_libraries(minizip PRIVATE MINIZIP::minizip)
|
||||
add_executable(miniunzip
|
||||
${MINIUNZIP_SRCS}
|
||||
${MINIUNZIP_HDRS})
|
||||
set_target_properties(miniunzip PROPERTIES
|
||||
EXPORT_NAME miniunzip_executable)
|
||||
target_compile_definitions(miniunzip
|
||||
PRIVATE
|
||||
$<$<BOOL:${MSVC}>:_CRT_SECURE_NO_WARNINGS>
|
||||
add_executable(miniunzip ${MINIUNZIP_SRCS} ${MINIUNZIP_HDRS})
|
||||
set_target_properties(miniunzip PROPERTIES EXPORT_NAME miniunzip_executable)
|
||||
target_compile_definitions(
|
||||
miniunzip PRIVATE $<$<BOOL:${MSVC}>:_CRT_SECURE_NO_WARNINGS>
|
||||
$<$<BOOL:NOT:${HAVE_FOPEN64}>:USE_FILE32API=1>)
|
||||
target_link_libraries(miniunzip PRIVATE MINIZIP::minizip)
|
||||
endif(MINIZIP_BUILD_SHARED)
|
||||
|
||||
if(MINIZIP_BUILD_STATIC)
|
||||
add_library(libminizipstatic STATIC
|
||||
${LIBMINIZIP_SRCS}
|
||||
${LIBMINIZIP_HDRS})
|
||||
add_library(libminizipstatic STATIC ${LIBMINIZIP_SRCS} ${LIBMINIZIP_HDRS})
|
||||
add_library(MINIZIP::minizipstatic ALIAS libminizipstatic)
|
||||
target_include_directories(libminizipstatic PUBLIC
|
||||
$<BUILD_INTERFACE:${minizip_SOURCE_DIR}>
|
||||
target_include_directories(
|
||||
libminizipstatic
|
||||
PUBLIC $<BUILD_INTERFACE:${minizip_SOURCE_DIR}>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
|
||||
target_compile_definitions(libminizipstatic
|
||||
PRIVATE
|
||||
$<$<BOOL:${MSVC}>:_CRT_SECURE_NO_WARNINGS>
|
||||
target_compile_definitions(
|
||||
libminizipstatic
|
||||
PRIVATE $<$<BOOL:${MSVC}>:_CRT_SECURE_NO_WARNINGS>
|
||||
$<$<BOOL:${BZIP2_FOUND}>:HAVE_BZIP2=1>
|
||||
$<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>
|
||||
$<$<BOOL:${HAVE_UNISTD_H}>:HAVE_UNISTD_H=1>
|
||||
$<$<BOOL:NOT:${HAVE_FOPEN64}>:USE_FILE32API=1>
|
||||
PUBLIC
|
||||
$<$<BOOL:${HAVE_OFF64_T}>:_LARGEFILE64_SOURCE=1>)
|
||||
set_target_properties(libminizipstatic PROPERTIES
|
||||
EXPORT_NAME minizipstatic
|
||||
PUBLIC $<$<BOOL:${HAVE_OFF64_T}>:_LARGEFILE64_SOURCE=1>)
|
||||
set_target_properties(
|
||||
libminizipstatic PROPERTIES EXPORT_NAME minizipstatic
|
||||
OUTPUT_NAME minizip${minizip_static_suffix})
|
||||
|
||||
if(CYGWIN)
|
||||
set_target_properties(libminizipstatic PROPERTIES
|
||||
SUFFIX ".dll.a")
|
||||
set_target_properties(libminizipstatic PROPERTIES SUFFIX ".dll.a")
|
||||
endif(CYGWIN)
|
||||
|
||||
target_link_libraries(libminizipstatic PUBLIC ZLIB::ZLIBSTATIC)
|
||||
add_executable(minizipstatic
|
||||
${MINIZIP_SRCS}
|
||||
${MINIZIP_HDRS})
|
||||
set_target_properties(minizipstatic PROPERTIES
|
||||
EXPORT_NAME minizip_static_executable)
|
||||
target_compile_definitions(minizipstatic
|
||||
PRIVATE
|
||||
$<$<BOOL:${MSVC}>:_CRT_SECURE_NO_WARNINGS>
|
||||
add_executable(minizipstatic ${MINIZIP_SRCS} ${MINIZIP_HDRS})
|
||||
set_target_properties(minizipstatic PROPERTIES EXPORT_NAME
|
||||
minizip_static_executable)
|
||||
target_compile_definitions(
|
||||
minizipstatic PRIVATE $<$<BOOL:${MSVC}>:_CRT_SECURE_NO_WARNINGS>
|
||||
$<$<BOOL:NOT:${HAVE_FOPEN64}>:USE_FILE32API=1>)
|
||||
target_link_libraries(minizipstatic PRIVATE MINIZIP::minizipstatic)
|
||||
add_executable(miniunzipstatic
|
||||
${MINIUNZIP_SRCS}
|
||||
${MINIUNZIP_HDRS})
|
||||
set_target_properties(miniunzipstatic PROPERTIES
|
||||
EXPORT_NAME miniunzip_static_executable)
|
||||
target_compile_definitions(miniunzipstatic
|
||||
PRIVATE
|
||||
$<$<BOOL:${MSVC}>:_CRT_SECURE_NO_WARNINGS>
|
||||
add_executable(miniunzipstatic ${MINIUNZIP_SRCS} ${MINIUNZIP_HDRS})
|
||||
set_target_properties(miniunzipstatic
|
||||
PROPERTIES EXPORT_NAME miniunzip_static_executable)
|
||||
target_compile_definitions(
|
||||
miniunzipstatic PRIVATE $<$<BOOL:${MSVC}>:_CRT_SECURE_NO_WARNINGS>
|
||||
$<$<BOOL:NOT:${HAVE_FOPEN64}>:USE_FILE32API=1>)
|
||||
target_link_libraries(miniunzipstatic PRIVATE MINIZIP::minizipstatic)
|
||||
endif(MINIZIP_BUILD_STATIC)
|
||||
|
||||
if(MINIZIP_INSTALL)
|
||||
if(MINIZIP_BUILD_SHARED)
|
||||
install(TARGETS libminizip minizip miniunzip
|
||||
install(
|
||||
TARGETS libminizip minizip miniunzip
|
||||
COMPONENT Runtime
|
||||
EXPORT minizipSharedExport
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
install(EXPORT minizipSharedExport
|
||||
install(
|
||||
EXPORT minizipSharedExport
|
||||
FILE minizip-shared.cmake
|
||||
NAMESPACE MINIZIP::
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/minizip)
|
||||
if(MINIZIP_INSTALL_COMPAT_DLL)
|
||||
install(FILES $<TARGET_FILE:libminizip>
|
||||
install(
|
||||
FILES $<TARGET_FILE:libminizip>
|
||||
COMPONENT Runtime
|
||||
RENAME libminizip-${minizip_VERSION_MAJOR}.dll
|
||||
DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||
endif(MINIZIP_INSTALL_COMPAT_DLL)
|
||||
|
||||
if(MSVC)
|
||||
install(FILES $<TARGET_PDB_FILE:libminizip>
|
||||
install(
|
||||
FILES $<TARGET_PDB_FILE:libminizip>
|
||||
COMPONENT Runtime
|
||||
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
CONFIGURATIONS Debug OR RelWithDebInfo
|
||||
OPTIONAL
|
||||
)
|
||||
OPTIONAL)
|
||||
endif(MSVC)
|
||||
endif(MINIZIP_BUILD_SHARED)
|
||||
|
||||
if(MINIZIP_BUILD_STATIC)
|
||||
install(TARGETS libminizipstatic
|
||||
install(
|
||||
TARGETS libminizipstatic
|
||||
COMPONENT Development
|
||||
TARGETS minizipstatic miniunzipstatic
|
||||
COMPONENT Runtime
|
||||
@ -281,24 +244,26 @@ if(MINIZIP_INSTALL)
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
install(EXPORT minizipStaticExport
|
||||
install(
|
||||
EXPORT minizipStaticExport
|
||||
FILE minizip-static.cmake
|
||||
NAMESPACE MINIZIP::
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/minizip)
|
||||
endif(MINIZIP_BUILD_STATIC)
|
||||
|
||||
configure_package_config_file(${minizip_SOURCE_DIR}/minizipConfig.cmake.in
|
||||
configure_package_config_file(
|
||||
${minizip_SOURCE_DIR}/minizipConfig.cmake.in
|
||||
${minizip_BINARY_DIR}/minizipConfig.cmake
|
||||
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/minizip)
|
||||
write_basic_package_version_file(
|
||||
"${minizip_BINARY_DIR}/minizipConfigVersion.cmake"
|
||||
VERSION "${minizip_VERSION}"
|
||||
COMPATIBILITY AnyNewerVersion)
|
||||
install(FILES
|
||||
${minizip_BINARY_DIR}/minizipConfig.cmake
|
||||
install(FILES ${minizip_BINARY_DIR}/minizipConfig.cmake
|
||||
${minizip_BINARY_DIR}/minizipConfigVersion.cmake
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/minizip)
|
||||
install(FILES ${LIBMINIZIP_HDRS}
|
||||
install(
|
||||
FILES ${LIBMINIZIP_HDRS}
|
||||
COMPONENT Development
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
endif(MINIZIP_INSTALL)
|
||||
@ -306,98 +271,108 @@ endif(MINIZIP_INSTALL)
|
||||
if(MINIZIP_BUILD_TESTING)
|
||||
enable_testing()
|
||||
|
||||
if(MINIZIP_BUILD_SHARED AND NOT ${CMAKE_SHARED_LIBRARY_SUFFIX} STREQUAL ".dll")
|
||||
add_test(NAME minizip_prepare_shared_zip
|
||||
COMMAND ${CMAKE_COMMAND} -DCREATE_SHARED=ON
|
||||
-P ${CMAKE_CURRENT_SOURCE_DIR}/test/test_helper.cm
|
||||
if(MINIZIP_BUILD_SHARED AND NOT ${CMAKE_SHARED_LIBRARY_SUFFIX} STREQUAL
|
||||
".dll")
|
||||
add_test(
|
||||
NAME minizip_prepare_shared_zip
|
||||
COMMAND ${CMAKE_COMMAND} -DCREATE_SHARED=ON -P
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test/test_helper.cm
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test)
|
||||
add_test(NAME minizip_zipping_test_file_shared
|
||||
add_test(
|
||||
NAME minizip_zipping_test_file_shared
|
||||
COMMAND minizip test_file_shared.zip test_file_shared.txt
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test)
|
||||
add_test(NAME minizip_prepare_shared_unzip
|
||||
COMMAND ${CMAKE_COMMAND} -DMOVE_SHARED=ON
|
||||
-P ${CMAKE_CURRENT_SOURCE_DIR}/test/test_helper.cm
|
||||
add_test(
|
||||
NAME minizip_prepare_shared_unzip
|
||||
COMMAND ${CMAKE_COMMAND} -DMOVE_SHARED=ON -P
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test/test_helper.cm
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test)
|
||||
add_test(NAME minizip_miniunzipping_test_file_shared.zip
|
||||
add_test(
|
||||
NAME minizip_miniunzipping_test_file_shared.zip
|
||||
COMMAND miniunzip test_file_shared.zip
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test)
|
||||
add_test(NAME minizip_compare_shared
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files
|
||||
test_file_shared.txt test_file_shared.orig
|
||||
add_test(
|
||||
NAME minizip_compare_shared
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files test_file_shared.txt
|
||||
test_file_shared.orig
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test)
|
||||
add_test(NAME minizip_clean_shared_zip
|
||||
COMMAND ${CMAKE_COMMAND} -DDELETE_SHARED=ON
|
||||
-P ${CMAKE_CURRENT_SOURCE_DIR}/test/test_helper.cm
|
||||
add_test(
|
||||
NAME minizip_clean_shared_zip
|
||||
COMMAND ${CMAKE_COMMAND} -DDELETE_SHARED=ON -P
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test/test_helper.cm
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test)
|
||||
set_tests_properties(minizip_prepare_shared_zip
|
||||
PROPERTIES
|
||||
FIXTURES_SETUP prepare_shared)
|
||||
set_tests_properties(minizip_zipping_test_file_shared
|
||||
PROPERTIES
|
||||
FIXTURES_REQUIRED prepare_shared
|
||||
FIXTURES_SETUP zip_shared)
|
||||
set_tests_properties(minizip_prepare_shared_unzip
|
||||
PROPERTIES
|
||||
FIXTURES_REQUIRED zip_shared
|
||||
FIXTURES_SETUP prepare_unzip_shared)
|
||||
set_tests_properties(minizip_miniunzipping_test_file_shared.zip
|
||||
PROPERTIES
|
||||
FIXTURES_REQUIRED prepare_unzip_shared
|
||||
FIXTURES_SETUP prepare_compare_shared)
|
||||
set_tests_properties(minizip_compare_shared
|
||||
PROPERTIES
|
||||
FIXTURES_REQUIRED prepare_compare_shared
|
||||
FIXTURES_SETUP compared_shared)
|
||||
PROPERTIES FIXTURES_SETUP prepare_shared)
|
||||
set_tests_properties(
|
||||
minizip_zipping_test_file_shared
|
||||
PROPERTIES FIXTURES_REQUIRED prepare_shared FIXTURES_SETUP
|
||||
zip_shared)
|
||||
set_tests_properties(
|
||||
minizip_prepare_shared_unzip
|
||||
PROPERTIES FIXTURES_REQUIRED zip_shared FIXTURES_SETUP
|
||||
prepare_unzip_shared)
|
||||
set_tests_properties(
|
||||
minizip_miniunzipping_test_file_shared.zip
|
||||
PROPERTIES FIXTURES_REQUIRED prepare_unzip_shared FIXTURES_SETUP
|
||||
prepare_compare_shared)
|
||||
set_tests_properties(
|
||||
minizip_compare_shared
|
||||
PROPERTIES FIXTURES_REQUIRED prepare_compare_shared FIXTURES_SETUP
|
||||
compared_shared)
|
||||
set_tests_properties(minizip_clean_shared_zip
|
||||
PROPERTIES
|
||||
FIXTURES_CLEANUP compared_shared)
|
||||
endif(MINIZIP_BUILD_SHARED AND NOT ${CMAKE_SHARED_LIBRARY_SUFFIX} STREQUAL ".dll")
|
||||
PROPERTIES FIXTURES_CLEANUP compared_shared)
|
||||
endif(MINIZIP_BUILD_SHARED AND NOT ${CMAKE_SHARED_LIBRARY_SUFFIX} STREQUAL
|
||||
".dll")
|
||||
|
||||
if(MINIZIP_BUILD_STATIC)
|
||||
add_test(NAME minizip_prepare_static_zip
|
||||
COMMAND ${CMAKE_COMMAND} -DCREATE_STATIC=ON
|
||||
-P ${CMAKE_CURRENT_SOURCE_DIR}/test/test_helper.cm
|
||||
add_test(
|
||||
NAME minizip_prepare_static_zip
|
||||
COMMAND ${CMAKE_COMMAND} -DCREATE_STATIC=ON -P
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test/test_helper.cm
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test)
|
||||
add_test(NAME minizip_zipping_test_file_static
|
||||
add_test(
|
||||
NAME minizip_zipping_test_file_static
|
||||
COMMAND minizipstatic test_file_static.zip test_file_static.txt
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test)
|
||||
add_test(NAME minizip_prepare_static_unzip
|
||||
COMMAND ${CMAKE_COMMAND} -DMOVE_STATIC=ON
|
||||
-P ${CMAKE_CURRENT_SOURCE_DIR}/test/test_helper.cm
|
||||
add_test(
|
||||
NAME minizip_prepare_static_unzip
|
||||
COMMAND ${CMAKE_COMMAND} -DMOVE_STATIC=ON -P
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test/test_helper.cm
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test)
|
||||
add_test(NAME minizip_miniunzipping_test_file_static.zip
|
||||
add_test(
|
||||
NAME minizip_miniunzipping_test_file_static.zip
|
||||
COMMAND miniunzipstatic test_file_static.zip
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test)
|
||||
add_test(NAME minizip_compare_static
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files
|
||||
test_file_static.txt test_file_static.orig
|
||||
add_test(
|
||||
NAME minizip_compare_static
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files test_file_static.txt
|
||||
test_file_static.orig
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test)
|
||||
add_test(NAME minizip_clean_static_zip
|
||||
COMMAND ${CMAKE_COMMAND} -DDELETE_STATIC=ON
|
||||
-P ${CMAKE_CURRENT_SOURCE_DIR}/test/test_helper.cm
|
||||
add_test(
|
||||
NAME minizip_clean_static_zip
|
||||
COMMAND ${CMAKE_COMMAND} -DDELETE_STATIC=ON -P
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test/test_helper.cm
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test)
|
||||
set_tests_properties(minizip_prepare_static_zip
|
||||
PROPERTIES
|
||||
FIXTURES_SETUP prepare_static)
|
||||
set_tests_properties(minizip_zipping_test_file_static
|
||||
PROPERTIES
|
||||
FIXTURES_REQUIRED prepare_static
|
||||
FIXTURES_SETUP zip_static)
|
||||
set_tests_properties(minizip_prepare_static_unzip
|
||||
PROPERTIES
|
||||
FIXTURES_REQUIRED zip_static
|
||||
FIXTURES_SETUP prepare_unzip_static)
|
||||
set_tests_properties(minizip_miniunzipping_test_file_static.zip
|
||||
PROPERTIES
|
||||
FIXTURES_REQUIRED prepare_unzip_static
|
||||
FIXTURES_SETUP prepare_compare_static)
|
||||
set_tests_properties(minizip_compare_static
|
||||
PROPERTIES
|
||||
FIXTURES_REQUIRED prepare_compare_static
|
||||
FIXTURES_SETUP compared_static)
|
||||
PROPERTIES FIXTURES_SETUP prepare_static)
|
||||
set_tests_properties(
|
||||
minizip_zipping_test_file_static
|
||||
PROPERTIES FIXTURES_REQUIRED prepare_static FIXTURES_SETUP
|
||||
zip_static)
|
||||
set_tests_properties(
|
||||
minizip_prepare_static_unzip
|
||||
PROPERTIES FIXTURES_REQUIRED zip_static FIXTURES_SETUP
|
||||
prepare_unzip_static)
|
||||
set_tests_properties(
|
||||
minizip_miniunzipping_test_file_static.zip
|
||||
PROPERTIES FIXTURES_REQUIRED prepare_unzip_static FIXTURES_SETUP
|
||||
prepare_compare_static)
|
||||
set_tests_properties(
|
||||
minizip_compare_static
|
||||
PROPERTIES FIXTURES_REQUIRED prepare_compare_static FIXTURES_SETUP
|
||||
compared_static)
|
||||
set_tests_properties(minizip_clean_static_zip
|
||||
PROPERTIES
|
||||
FIXTURES_CLEANUP compared_static)
|
||||
PROPERTIES FIXTURES_CLEANUP compared_static)
|
||||
endif(MINIZIP_BUILD_STATIC)
|
||||
|
||||
add_subdirectory(test)
|
||||
|
@ -15,7 +15,7 @@ if(minizip_FIND_COMPONENTS)
|
||||
find_dependency(ZLIB CONFIG COMPONENTS ${minizip_FIND_COMPONENTS})
|
||||
|
||||
foreach(_comp ${minizip_FIND_COMPONENTS})
|
||||
if (NOT _comp IN_LIST _MINIZIP_supported_components)
|
||||
if(NOT _comp IN_LIST _MINIZIP_supported_components)
|
||||
set(minizip_FOUND False)
|
||||
set(minizip_NOT_FOUND_MESSAGE "Unsupported component: ${_comp}")
|
||||
endif(NOT _comp IN_LIST _MINIZIP_supported_components)
|
||||
|
@ -1,4 +1,4 @@
|
||||
#if we are built from with zlib, use this path's)
|
||||
# if we are built from with zlib, use this path's)
|
||||
if(DEFINED ZLIB_BUILD_SHARED)
|
||||
set(WORK_DIR ${zlib_BINARY_DIR})
|
||||
set(inst_setup minizip_minizip_install)
|
||||
@ -7,31 +7,30 @@ else(DEFINED ZLIB_BUILD_SHARED)
|
||||
set(inst_setup minizip_minizip_install)
|
||||
set(ZLIB_ARG "-DZLIB_DIR=${ZLIB_DIR}")
|
||||
|
||||
add_test(NAME minizip_install
|
||||
COMMAND ${CMAKE_COMMAND} --install ${minizip_BINARY_DIR}
|
||||
--prefix ${CMAKE_CURRENT_BINARY_DIR}/test_install
|
||||
--config $<CONFIG>
|
||||
add_test(
|
||||
NAME minizip_install
|
||||
COMMAND ${CMAKE_COMMAND} --install ${minizip_BINARY_DIR} --prefix
|
||||
${CMAKE_CURRENT_BINARY_DIR}/test_install --config $<CONFIG>
|
||||
WORKING_DIRECTORY ${minizip_BINARY_DIR})
|
||||
|
||||
set_tests_properties(minizip_install
|
||||
PROPERTIES
|
||||
FIXTURES_SETUP minizip_install)
|
||||
set_tests_properties(minizip_install PROPERTIES FIXTURES_SETUP
|
||||
minizip_install)
|
||||
endif(DEFINED ZLIB_BUILD_SHARED)
|
||||
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/findpackage_test)
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test)
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test)
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/find_package_test.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/findpackage_test/CMakeLists.txt
|
||||
@ONLY)
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/find_package_test.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/findpackage_test/CMakeLists.txt @ONLY)
|
||||
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/add_subdirectory_test.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test/CMakeLists.txt
|
||||
@ONLY)
|
||||
${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test/CMakeLists.txt @ONLY)
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/add_subdirectory_exclude_test.cmake.in
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/add_subdirectory_exclude_test.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test/CMakeLists.txt
|
||||
@ONLY)
|
||||
|
||||
@ -45,83 +44,78 @@ endif(GENERATOR)
|
||||
#
|
||||
# findpackage_test
|
||||
#
|
||||
add_test(NAME minizip_find_package_configure
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
${PLATFORM}
|
||||
add_test(
|
||||
NAME minizip_find_package_configure
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} ${PLATFORM}
|
||||
-B${CMAKE_CURRENT_BINARY_DIR}/findpackage_test_build
|
||||
-DCMAKE_BUILD_TYPE=$<CONFIG>
|
||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_BUILD_TYPE=$<CONFIG> -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
|
||||
-DCMAKE_INSTALL_PREFIX=${WORK_DIR}/test/test_install
|
||||
${ZLIB_ARG}
|
||||
--fresh
|
||||
-G "${CMAKE_GENERATOR}"
|
||||
-DCMAKE_INSTALL_PREFIX=${WORK_DIR}/test/test_install ${ZLIB_ARG}
|
||||
--fresh -G "${CMAKE_GENERATOR}"
|
||||
-S${CMAKE_CURRENT_BINARY_DIR}/findpackage_test)
|
||||
|
||||
add_test(NAME minizip_find_package_build
|
||||
COMMAND ${CMAKE_COMMAND} --build .
|
||||
--config $<CONFIG>
|
||||
add_test(
|
||||
NAME minizip_find_package_build
|
||||
COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/findpackage_test_build)
|
||||
|
||||
set_tests_properties(minizip_find_package_configure PROPERTIES
|
||||
FIXTURES_REQUIRED ${inst_setup}
|
||||
set_tests_properties(
|
||||
minizip_find_package_configure PROPERTIES FIXTURES_REQUIRED ${inst_setup}
|
||||
FIXTURES_SETUP mzfp_config)
|
||||
|
||||
set_tests_properties(minizip_find_package_build PROPERTIES
|
||||
FIXTURES_REQUIRED mzfp_config)
|
||||
set_tests_properties(minizip_find_package_build PROPERTIES FIXTURES_REQUIRED
|
||||
mzfp_config)
|
||||
|
||||
#
|
||||
# add_subdirectory_test
|
||||
#
|
||||
add_test(NAME minizip_add_subdirectory_configure
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
${PLATFORM}
|
||||
add_test(
|
||||
NAME minizip_add_subdirectory_configure
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} ${PLATFORM}
|
||||
-B${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test_build
|
||||
-DCMAKE_BUILD_TYPE=$<CONFIG>
|
||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_BUILD_TYPE=$<CONFIG> -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
|
||||
-DCMAKE_INSTALL_PREFIX=${WORK_DIR}/test/test_install
|
||||
${ZLIB_ARG}
|
||||
--fresh
|
||||
-G "${CMAKE_GENERATOR}"
|
||||
-DCMAKE_INSTALL_PREFIX=${WORK_DIR}/test/test_install ${ZLIB_ARG}
|
||||
--fresh -G "${CMAKE_GENERATOR}"
|
||||
-S${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test)
|
||||
|
||||
add_test(NAME minizip_add_subdirectory_build
|
||||
COMMAND ${CMAKE_COMMAND} --build .
|
||||
--config $<CONFIG>
|
||||
add_test(
|
||||
NAME minizip_add_subdirectory_build
|
||||
COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test_build)
|
||||
|
||||
set_tests_properties(minizip_add_subdirectory_configure PROPERTIES
|
||||
FIXTURES_REQUIRED ${inst_setup}
|
||||
FIXTURES_SETUP mzas_config)
|
||||
set_tests_properties(
|
||||
minizip_add_subdirectory_configure
|
||||
PROPERTIES FIXTURES_REQUIRED ${inst_setup} FIXTURES_SETUP mzas_config)
|
||||
|
||||
set_tests_properties(minizip_add_subdirectory_build PROPERTIES
|
||||
FIXTURES_REQUIRED mzas_config)
|
||||
set_tests_properties(minizip_add_subdirectory_build PROPERTIES FIXTURES_REQUIRED
|
||||
mzas_config)
|
||||
|
||||
#
|
||||
# add_subdirectory_exclude_test
|
||||
#
|
||||
add_test(NAME minizip_add_subdirectory_exclude_configure
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
${PLATFORM}
|
||||
add_test(
|
||||
NAME minizip_add_subdirectory_exclude_configure
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} ${PLATFORM}
|
||||
-B${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test_build
|
||||
-DCMAKE_BUILD_TYPE=$<CONFIG>
|
||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_BUILD_TYPE=$<CONFIG> -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
|
||||
-DCMAKE_INSTALL_PREFIX=${WORK_DIR}/test/test_install
|
||||
${ZLIB_ARG}
|
||||
--fresh
|
||||
-G "${CMAKE_GENERATOR}"
|
||||
-DCMAKE_INSTALL_PREFIX=${WORK_DIR}/test/test_install ${ZLIB_ARG}
|
||||
--fresh -G "${CMAKE_GENERATOR}"
|
||||
-S${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test)
|
||||
|
||||
add_test(NAME minizip_add_subdirectory_exclude_build
|
||||
COMMAND ${CMAKE_COMMAND} --build .
|
||||
--config $<CONFIG>
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test_build)
|
||||
add_test(
|
||||
NAME minizip_add_subdirectory_exclude_build
|
||||
COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>
|
||||
WORKING_DIRECTORY
|
||||
${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test_build)
|
||||
|
||||
set_tests_properties(minizip_add_subdirectory_exclude_configure PROPERTIES
|
||||
FIXTURES_REQUIRED ${inst_setup}
|
||||
FIXTURES_SETUP mzasx_config)
|
||||
set_tests_properties(
|
||||
minizip_add_subdirectory_exclude_configure
|
||||
PROPERTIES FIXTURES_REQUIRED ${inst_setup} FIXTURES_SETUP mzasx_config)
|
||||
|
||||
set_tests_properties(minizip_add_subdirectory_exclude_build PROPERTIES
|
||||
FIXTURES_REQUIRED mzasx_config)
|
||||
set_tests_properties(minizip_add_subdirectory_exclude_build
|
||||
PROPERTIES FIXTURES_REQUIRED mzasx_config)
|
||||
|
@ -1,6 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(minizip_add_subdirectory_exclude_from_all
|
||||
project(
|
||||
minizip_add_subdirectory_exclude_from_all
|
||||
LANGUAGES C
|
||||
VERSION @minizip_VERSION@)
|
||||
|
||||
@ -9,13 +10,13 @@ option(MINIZIP_BUILD_SHARED "" @MINIZIP_BUILD_SHARED@)
|
||||
option(MINIZIP_BUILD_STATIC "" @MINIZIP_BUILD_STATIC@)
|
||||
option(MINIZIP_ENABLE_BZIP2 "" @MINIZIP_ENABLE_BZIP2@)
|
||||
|
||||
add_subdirectory(@minizip_SOURCE_DIR@ ${CMAKE_CURRENT_BINARY_DIR}/minizip EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(@minizip_SOURCE_DIR@ ${CMAKE_CURRENT_BINARY_DIR}/minizip
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
set(MINIZIP_SRCS
|
||||
@minizip_SOURCE_DIR@/ioapi.c
|
||||
$<$<BOOL:${WIN32}>:@minizip_SOURCE_DIR@/iowin32.c>
|
||||
@minizip_SOURCE_DIR@/minizip.c
|
||||
@minizip_SOURCE_DIR@/zip.c)
|
||||
@minizip_SOURCE_DIR@/minizip.c @minizip_SOURCE_DIR@/zip.c)
|
||||
|
||||
if(MINIZIP_BUILD_SHARED)
|
||||
add_executable(test_example ${MINIZIP_SRCS})
|
||||
|
@ -1,6 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(minizip_add_subdirectory_exclude_from_all
|
||||
project(
|
||||
minizip_add_subdirectory_exclude_from_all
|
||||
LANGUAGES C
|
||||
VERSION @minizip_VERSION@)
|
||||
|
||||
@ -14,8 +15,7 @@ add_subdirectory(@minizip_SOURCE_DIR@ ${CMAKE_CURRENT_BINARY_DIR}/minizip)
|
||||
set(MINIZIP_SRCS
|
||||
@minizip_SOURCE_DIR@/ioapi.c
|
||||
$<$<BOOL:${WIN32}>:@minizip_SOURCE_DIR@/iowin32.c>
|
||||
@minizip_SOURCE_DIR@/minizip.c
|
||||
@minizip_SOURCE_DIR@/zip.c)
|
||||
@minizip_SOURCE_DIR@/minizip.c @minizip_SOURCE_DIR@/zip.c)
|
||||
|
||||
if(MINIZIP_BUILD_SHARED)
|
||||
add_executable(test_example ${MINIZIP_SRCS})
|
||||
|
@ -1,6 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(minizip_find_package
|
||||
project(
|
||||
minizip_find_package
|
||||
LANGUAGES C
|
||||
VERSION @minizip_VERSION@)
|
||||
|
||||
@ -11,8 +12,7 @@ find_package(minizip ${minizip_VERSION} CONFIG REQUIRED)
|
||||
set(MINIZIP_SRCS
|
||||
@minizip_SOURCE_DIR@/ioapi.c
|
||||
$<$<BOOL:${WIN32}>:@minizip_SOURCE_DIR@/iowin32.c>
|
||||
@minizip_SOURCE_DIR@/minizip.c
|
||||
@minizip_SOURCE_DIR@/zip.c)
|
||||
@minizip_SOURCE_DIR@/minizip.c @minizip_SOURCE_DIR@/zip.c)
|
||||
|
||||
if(MINIZIP_BUILD_SHARED)
|
||||
add_executable(test_example ${MINIZIP_SRCS})
|
||||
|
@ -1,68 +1,78 @@
|
||||
function (ZLIB_findTestEnv testName)
|
||||
set (testEnv "PATH=")
|
||||
function(ZLIB_findTestEnv testName)
|
||||
set(testEnv "PATH=")
|
||||
|
||||
if (MSVC OR MINGW)
|
||||
set (separator "\\\;")
|
||||
if(MSVC OR MINGW)
|
||||
set(separator "\\\;")
|
||||
else()
|
||||
set (separator ":")
|
||||
set(separator ":")
|
||||
endif()
|
||||
|
||||
string (APPEND testEnv "$<TARGET_FILE_DIR:ZLIB::ZLIB>${separator}")
|
||||
string (APPEND testEnv "$ENV{PATH}")
|
||||
string(APPEND testEnv "$<TARGET_FILE_DIR:ZLIB::ZLIB>${separator}")
|
||||
string(APPEND testEnv "$ENV{PATH}")
|
||||
|
||||
set_tests_properties (${testName} PROPERTIES
|
||||
ENVIRONMENT "${testEnv}"
|
||||
)
|
||||
set_tests_properties(${testName} PROPERTIES ENVIRONMENT "${testEnv}")
|
||||
endfunction()
|
||||
|
||||
if(ZLIB_BUILD_SHARED)
|
||||
add_executable(zlib_example example.c)
|
||||
target_link_libraries(zlib_example ZLIB::ZLIB)
|
||||
add_test(NAME zlib_example
|
||||
COMMAND zlib_example)
|
||||
add_test(NAME zlib_example COMMAND zlib_example)
|
||||
|
||||
add_executable(minigzip minigzip.c)
|
||||
target_compile_definitions(minigzip
|
||||
PRIVATE
|
||||
$<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>)
|
||||
target_compile_definitions(
|
||||
minigzip PRIVATE $<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>)
|
||||
target_link_libraries(minigzip ZLIB::ZLIB)
|
||||
|
||||
if (MSVC OR MSYS OR MINGW OR CYGWIN)
|
||||
ZLIB_findTestEnv (zlib_example)
|
||||
endif (MSVC OR MSYS OR MINGW OR CYGWIN)
|
||||
if(MSVC
|
||||
OR MSYS
|
||||
OR MINGW
|
||||
OR CYGWIN)
|
||||
zlib_findtestenv(zlib_example)
|
||||
endif(
|
||||
MSVC
|
||||
OR MSYS
|
||||
OR MINGW
|
||||
OR CYGWIN)
|
||||
|
||||
if(HAVE_OFF64_T)
|
||||
add_executable(zlib_example64 example.c)
|
||||
target_compile_definitions(zlib_example64
|
||||
PRIVATE
|
||||
LARGEFILE64_SOURCE=1
|
||||
target_compile_definitions(
|
||||
zlib_example64
|
||||
PRIVATE LARGEFILE64_SOURCE=1
|
||||
$<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>)
|
||||
target_link_libraries(zlib_example64 ZLIB::ZLIB)
|
||||
add_test(NAME zlib_example64
|
||||
COMMAND zlib_example64)
|
||||
add_test(NAME zlib_example64 COMMAND zlib_example64)
|
||||
|
||||
if (MSVC OR MSYS OR MINGW OR CYGWIN)
|
||||
ZLIB_findTestEnv (zlib_example64)
|
||||
endif (MSVC OR MSYS OR MINGW OR CYGWIN)
|
||||
if(MSVC
|
||||
OR MSYS
|
||||
OR MINGW
|
||||
OR CYGWIN)
|
||||
zlib_findtestenv(zlib_example64)
|
||||
endif(
|
||||
MSVC
|
||||
OR MSYS
|
||||
OR MINGW
|
||||
OR CYGWIN)
|
||||
endif(HAVE_OFF64_T)
|
||||
endif(ZLIB_BUILD_SHARED)
|
||||
|
||||
if(ZLIB_BUILD_STATIC)
|
||||
add_executable(zlib_static_example example.c)
|
||||
target_link_libraries(zlib_static_example ZLIB::ZLIBSTATIC)
|
||||
target_compile_definitions(zlib_static_example
|
||||
PRIVATE
|
||||
$<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>)
|
||||
add_test(NAME zlib_static_example
|
||||
COMMAND zlib_static_example)
|
||||
target_compile_definitions(
|
||||
zlib_static_example
|
||||
PRIVATE $<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>)
|
||||
add_test(NAME zlib_static_example COMMAND zlib_static_example)
|
||||
|
||||
add_executable(static_minigzip minigzip.c)
|
||||
target_link_libraries(static_minigzip ZLIB::ZLIBSTATIC)
|
||||
|
||||
if(${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR
|
||||
${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
|
||||
if(${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL
|
||||
"Clang")
|
||||
set(CFLAGS_OLD ${CMAKE_C_FLAGS})
|
||||
set({CMAKE_C_FLAGS "" CACHE STRING "" FORCE)
|
||||
set({CMAKE_C_FLAGS
|
||||
""
|
||||
CACHE STRING "" FORCE)
|
||||
|
||||
if(${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
|
||||
find_program(GCOV_EXECUTABLE gcov)
|
||||
@ -84,57 +94,57 @@ if(ZLIB_BUILD_STATIC)
|
||||
target_link_libraries(infcover ZLIB::ZLIBSTATIC)
|
||||
target_compile_options(infcover PRIVATE -coverage)
|
||||
target_link_options(infcover PRIVATE -coverage)
|
||||
target_compile_definitions(infcover
|
||||
PRIVATE
|
||||
$<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>)
|
||||
add_test (NAME zlib-coverage COMMAND infcover)
|
||||
set (INFCOVER_DIR
|
||||
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/infcover.dir)
|
||||
add_test (NAME zlib-coverage-summary
|
||||
COMMAND ${GCOV_EXECUTABLE} ${llvm_option}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/infcover.c
|
||||
-o ${INFCOVER_DIR}/infcover.c.gcda)
|
||||
set_tests_properties(zlib-coverage-summary PROPERTIES DEPENDS zlib-coverage)
|
||||
set({CMAKE_C_FLAGS ${CFLAGS_OLD} CACHE STRING "" FORCE)
|
||||
endif(${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR
|
||||
${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
|
||||
target_compile_definitions(
|
||||
infcover PRIVATE $<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>)
|
||||
add_test(NAME zlib-coverage COMMAND infcover)
|
||||
set(INFCOVER_DIR ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/infcover.dir)
|
||||
add_test(
|
||||
NAME zlib-coverage-summary
|
||||
COMMAND
|
||||
${GCOV_EXECUTABLE} ${llvm_option}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/infcover.c -o
|
||||
${INFCOVER_DIR}/infcover.c.gcda)
|
||||
set_tests_properties(zlib-coverage-summary PROPERTIES DEPENDS
|
||||
zlib-coverage)
|
||||
set({CMAKE_C_FLAGS
|
||||
${CFLAGS_OLD}
|
||||
CACHE STRING "" FORCE)
|
||||
endif(${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID}
|
||||
STREQUAL "Clang")
|
||||
|
||||
if(HAVE_OFF64_T)
|
||||
add_executable(zlib_static_example64 example.c)
|
||||
target_compile_definitions(zlib_static_example64
|
||||
PRIVATE
|
||||
LARGEFILE64_SOURCE=1
|
||||
target_compile_definitions(
|
||||
zlib_static_example64
|
||||
PRIVATE LARGEFILE64_SOURCE=1
|
||||
$<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>)
|
||||
target_link_libraries(zlib_static_example64 ZLIB::ZLIBSTATIC)
|
||||
add_test(NAME zlib_static_example64
|
||||
COMMAND zlib_static_example64)
|
||||
add_test(NAME zlib_static_example64 COMMAND zlib_static_example64)
|
||||
endif(HAVE_OFF64_T)
|
||||
endif(ZLIB_BUILD_STATIC)
|
||||
|
||||
add_test(NAME zlib_install
|
||||
COMMAND ${CMAKE_COMMAND} --install ${zlib_BINARY_DIR}
|
||||
--prefix ${CMAKE_CURRENT_BINARY_DIR}/test_install
|
||||
--config $<CONFIG>
|
||||
add_test(
|
||||
NAME zlib_install
|
||||
COMMAND ${CMAKE_COMMAND} --install ${zlib_BINARY_DIR} --prefix
|
||||
${CMAKE_CURRENT_BINARY_DIR}/test_install --config $<CONFIG>
|
||||
WORKING_DIRECTORY ${zlib_BINARY_DIR})
|
||||
|
||||
set_tests_properties(zlib_install
|
||||
PROPERTIES
|
||||
FIXTURES_SETUP zlib_install)
|
||||
set_tests_properties(zlib_install PROPERTIES FIXTURES_SETUP zlib_install)
|
||||
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/findpackage_test)
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test)
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test)
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/find_package_test.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/findpackage_test/CMakeLists.txt
|
||||
@ONLY)
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/find_package_test.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/findpackage_test/CMakeLists.txt @ONLY)
|
||||
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/add_subdirectory_test.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test/CMakeLists.txt
|
||||
@ONLY)
|
||||
${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test/CMakeLists.txt @ONLY)
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/add_subdirectory_exclude_test.cmake.in
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/add_subdirectory_exclude_test.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test/CMakeLists.txt
|
||||
@ONLY)
|
||||
|
||||
@ -147,107 +157,107 @@ endif(GENERATOR)
|
||||
#
|
||||
# findpackage_test
|
||||
#
|
||||
add_test(NAME zlib_find_package_configure
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
${PLATFORM}
|
||||
add_test(
|
||||
NAME zlib_find_package_configure
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} ${PLATFORM}
|
||||
-B${CMAKE_CURRENT_BINARY_DIR}/findpackage_test_build
|
||||
-DCMAKE_BUILD_TYPE=$<CONFIG>
|
||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_BUILD_TYPE=$<CONFIG> -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
|
||||
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/test_install
|
||||
--fresh
|
||||
-G "${CMAKE_GENERATOR}"
|
||||
-S${CMAKE_CURRENT_BINARY_DIR}/findpackage_test)
|
||||
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/test_install --fresh
|
||||
-G "${CMAKE_GENERATOR}" -S${CMAKE_CURRENT_BINARY_DIR}/findpackage_test)
|
||||
|
||||
add_test(NAME zlib_find_package_build
|
||||
COMMAND ${CMAKE_COMMAND} --build .
|
||||
--config $<CONFIG>
|
||||
add_test(
|
||||
NAME zlib_find_package_build
|
||||
COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/findpackage_test_build)
|
||||
|
||||
add_test(NAME zlib_find_package_test
|
||||
add_test(
|
||||
NAME zlib_find_package_test
|
||||
COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIG>
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/findpackage_test_build)
|
||||
|
||||
set_tests_properties(zlib_find_package_configure PROPERTIES
|
||||
FIXTURES_REQUIRED zlib_install
|
||||
set_tests_properties(
|
||||
zlib_find_package_configure PROPERTIES FIXTURES_REQUIRED zlib_install
|
||||
FIXTURES_SETUP fp_config)
|
||||
|
||||
set_tests_properties(zlib_find_package_build PROPERTIES
|
||||
FIXTURES_REQUIRED fp_config
|
||||
set_tests_properties(
|
||||
zlib_find_package_build PROPERTIES FIXTURES_REQUIRED fp_config
|
||||
FIXTURES_SETUP fp_build)
|
||||
|
||||
set_tests_properties(zlib_find_package_test PROPERTIES
|
||||
FIXTURES_REQUIRED fp_build
|
||||
ENVIRONMENT CTEST_OUTPUT_ON_FAILURE=1)
|
||||
set_tests_properties(
|
||||
zlib_find_package_test PROPERTIES FIXTURES_REQUIRED fp_build ENVIRONMENT
|
||||
CTEST_OUTPUT_ON_FAILURE=1)
|
||||
|
||||
#
|
||||
# add_subdirectory_test
|
||||
#
|
||||
add_test(NAME zlib_add_subdirectory_configure
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
${PLATFORM}
|
||||
add_test(
|
||||
NAME zlib_add_subdirectory_configure
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} ${PLATFORM}
|
||||
-B${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test_build
|
||||
-DCMAKE_BUILD_TYPE=$<CONFIG>
|
||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_BUILD_TYPE=$<CONFIG> -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
|
||||
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/test_install
|
||||
--fresh
|
||||
-G "${CMAKE_GENERATOR}"
|
||||
-S${CMAKE_CURRENT_BINARY_DIR}/findpackage_test)
|
||||
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/test_install --fresh
|
||||
-G "${CMAKE_GENERATOR}" -S${CMAKE_CURRENT_BINARY_DIR}/findpackage_test)
|
||||
|
||||
add_test(NAME zlib_add_subdirectory_build
|
||||
COMMAND ${CMAKE_COMMAND} --build .
|
||||
--config $<CONFIG>
|
||||
add_test(
|
||||
NAME zlib_add_subdirectory_build
|
||||
COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test_build)
|
||||
|
||||
add_test(NAME zlib_add_subdirectory_test
|
||||
add_test(
|
||||
NAME zlib_add_subdirectory_test
|
||||
COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIG>
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test_build)
|
||||
|
||||
set_tests_properties(zlib_add_subdirectory_configure PROPERTIES
|
||||
FIXTURES_REQUIRED zlib_install
|
||||
set_tests_properties(
|
||||
zlib_add_subdirectory_configure PROPERTIES FIXTURES_REQUIRED zlib_install
|
||||
FIXTURES_SETUP as_config)
|
||||
|
||||
set_tests_properties(zlib_add_subdirectory_build PROPERTIES
|
||||
FIXTURES_REQUIRED as_config
|
||||
set_tests_properties(
|
||||
zlib_add_subdirectory_build PROPERTIES FIXTURES_REQUIRED as_config
|
||||
FIXTURES_SETUP as_build)
|
||||
|
||||
set_tests_properties(zlib_add_subdirectory_test PROPERTIES
|
||||
FIXTURES_REQUIRED as_build
|
||||
set_tests_properties(
|
||||
zlib_add_subdirectory_test PROPERTIES FIXTURES_REQUIRED as_build
|
||||
ENVIRONMENT CTEST_OUTPUT_ON_FAILURE=1)
|
||||
|
||||
#
|
||||
# add_subdirectory_exclude_test
|
||||
#
|
||||
add_test(NAME zlib_add_subdirectory_exclude_configure
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
${PLATFORM}
|
||||
add_test(
|
||||
NAME zlib_add_subdirectory_exclude_configure
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} ${PLATFORM}
|
||||
-B${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test_build
|
||||
-DCMAKE_BUILD_TYPE=$<CONFIG>
|
||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_BUILD_TYPE=$<CONFIG> -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
|
||||
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/test_install
|
||||
--fresh
|
||||
-G "${CMAKE_GENERATOR}"
|
||||
-S${CMAKE_CURRENT_BINARY_DIR}/findpackage_test)
|
||||
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/test_install --fresh
|
||||
-G "${CMAKE_GENERATOR}" -S${CMAKE_CURRENT_BINARY_DIR}/findpackage_test)
|
||||
|
||||
add_test(NAME zlib_add_subdirectory_exclude_build
|
||||
COMMAND ${CMAKE_COMMAND} --build .
|
||||
--config $<CONFIG>
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test_build)
|
||||
add_test(
|
||||
NAME zlib_add_subdirectory_exclude_build
|
||||
COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>
|
||||
WORKING_DIRECTORY
|
||||
${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test_build)
|
||||
|
||||
add_test(NAME zlib_add_subdirectory_exclude_test
|
||||
add_test(
|
||||
NAME zlib_add_subdirectory_exclude_test
|
||||
COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIG>
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test_build)
|
||||
WORKING_DIRECTORY
|
||||
${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test_build)
|
||||
|
||||
set_tests_properties(zlib_add_subdirectory_exclude_configure PROPERTIES
|
||||
FIXTURES_REQUIRED zlib_install
|
||||
FIXTURES_SETUP asx_config)
|
||||
set_tests_properties(
|
||||
zlib_add_subdirectory_exclude_configure
|
||||
PROPERTIES FIXTURES_REQUIRED zlib_install FIXTURES_SETUP asx_config)
|
||||
|
||||
set_tests_properties(zlib_add_subdirectory_exclude_build PROPERTIES
|
||||
FIXTURES_REQUIRED as_config
|
||||
set_tests_properties(
|
||||
zlib_add_subdirectory_exclude_build PROPERTIES FIXTURES_REQUIRED as_config
|
||||
FIXTURES_SETUP asx_build)
|
||||
|
||||
set_tests_properties(zlib_add_subdirectory_exclude_test PROPERTIES
|
||||
FIXTURES_REQUIRED asx_build
|
||||
ENVIRONMENT CTEST_OUTPUT_ON_FAILURE=1)
|
||||
set_tests_properties(
|
||||
zlib_add_subdirectory_exclude_test
|
||||
PROPERTIES FIXTURES_REQUIRED asx_build ENVIRONMENT
|
||||
CTEST_OUTPUT_ON_FAILURE=1)
|
||||
|
@ -1,6 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
|
||||
project(zlib_find_package_test
|
||||
project(
|
||||
zlib_find_package_test
|
||||
LANGUAGES C
|
||||
VERSION @zlib_VERSION@)
|
||||
|
||||
@ -9,7 +10,8 @@ option(ZLIB_BUILD_TESTING "" OFF)
|
||||
option(ZLIB_BUILD_SHARED "" @ZLIB_BUILD_SHARED@)
|
||||
option(ZLIB_BUILD_STATIC "" @ZLIB_BUILD_STATIC@)
|
||||
|
||||
add_subdirectory(@zlib_SOURCE_DIR@ ${CMAKE_CURRENT_BINARY_DIR}/zlib EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(@zlib_SOURCE_DIR@ ${CMAKE_CURRENT_BINARY_DIR}/zlib
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
if(ZLIB_BUILD_SHARED)
|
||||
add_executable(test_example @zlib_SOURCE_DIR@/test/example.c)
|
||||
@ -23,6 +25,5 @@ endif(ZLIB_BUILD_SHARED)
|
||||
if(ZLIB_BUILD_STATIC)
|
||||
add_executable(test_example_static @zlib_SOURCE_DIR@/test/example.c)
|
||||
target_link_libraries(test_example_static ZLIB::ZLIBSTATIC)
|
||||
add_test(NAME zlib_test_example_static
|
||||
COMMAND test_example_static)
|
||||
add_test(NAME zlib_test_example_static COMMAND test_example_static)
|
||||
endif(ZLIB_BUILD_STATIC)
|
||||
|
@ -1,6 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
|
||||
project(zlib_find_package_test
|
||||
project(
|
||||
zlib_find_package_test
|
||||
LANGUAGES C
|
||||
VERSION @zlib_VERSION@)
|
||||
|
||||
@ -23,6 +24,5 @@ endif(ZLIB_BUILD_SHARED)
|
||||
if(ZLIB_BUILD_STATIC)
|
||||
add_executable(test_example_static @zlib_SOURCE_DIR@/test/example.c)
|
||||
target_link_libraries(test_example_static ZLIB::ZLIBSTATIC)
|
||||
add_test(NAME zlib_test_example_static
|
||||
COMMAND test_example_static)
|
||||
add_test(NAME zlib_test_example_static COMMAND test_example_static)
|
||||
endif(@ZLIB_BUILD_STATIC)
|
||||
|
@ -1,6 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
|
||||
project(zlib_find_package_test
|
||||
project(
|
||||
zlib_find_package_test
|
||||
LANGUAGES C
|
||||
VERSION @zlib_VERSION@)
|
||||
|
||||
@ -21,6 +22,5 @@ endif(ZLIB_BUILD_SHARED)
|
||||
if(ZLIB_BUILD_STATIC)
|
||||
add_executable(test_example_static @zlib_SOURCE_DIR@/test/example.c)
|
||||
target_link_libraries(test_example_static ZLIB::ZLIBSTATIC)
|
||||
add_test(NAME zlib_test_example_static
|
||||
COMMAND test_example_static)
|
||||
add_test(NAME zlib_test_example_static COMMAND test_example_static)
|
||||
endif(ZLIB_BUILD_STATIC)
|
||||
|
@ -12,7 +12,7 @@ endif(@ZLIB_BUILD_STATIC@)
|
||||
|
||||
if(ZLIB_FIND_COMPONENTS)
|
||||
foreach(_comp ${ZLIB_FIND_COMPONENTS})
|
||||
if (NOT _comp IN_LIST _ZLIB_supported_components)
|
||||
if(NOT _comp IN_LIST _ZLIB_supported_components)
|
||||
set(ZLIB_FOUND False)
|
||||
set(ZLIB_NOT_FOUND_MESSAGE "Unsupported component: ${_comp}")
|
||||
endif(NOT _comp IN_LIST _ZLIB_supported_components)
|
||||
|
Loading…
x
Reference in New Issue
Block a user