diff options
author | Vollstrecker <werner@vollstreckernet.de> | 2025-01-22 17:24:17 +0100 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2025-01-31 20:02:26 -0800 |
commit | 6c224f159e6d940f775c017b1bc354d39d74ee48 (patch) | |
tree | 8a88f9b98ce02123206f418df7c2e62df6dc9f1f | |
parent | 213998f2b0dbe21b50f18c242ddb43b34e79b75f (diff) | |
download | zlib-6c224f159e6d940f775c017b1bc354d39d74ee48.tar.gz zlib-6c224f159e6d940f775c017b1bc354d39d74ee48.tar.bz2 zlib-6c224f159e6d940f775c017b1bc354d39d74ee48.zip |
CMake: Change README-cmake to README-cmake.md with formatting.
Per @ClausKlein suggestion.
-rw-r--r-- | README-cmake.md | 83 | ||||
-rw-r--r-- | README.cmake | 76 |
2 files changed, 83 insertions, 76 deletions
diff --git a/README-cmake.md b/README-cmake.md new file mode 100644 index 0000000..7258f9c --- /dev/null +++ b/README-cmake.md | |||
@@ -0,0 +1,83 @@ | |||
1 | # For building with cmake at least version 3.12 (minizip 3.12) is needed | ||
2 | |||
3 | In most cases the usual | ||
4 | |||
5 | cmake -S . -B build -D CMAKE_BUILD_TYPE=Release | ||
6 | |||
7 | will create everything you need, however if you want something off default you can adjust several options fit your needs. | ||
8 | Every option is list below (excluding the cmake-standard options), they can be set via cmake-gui or on cmdline with | ||
9 | |||
10 | -D<option>=ON/OFF | ||
11 | |||
12 | ## ZLIB-options with defaults ## | ||
13 | |||
14 | ZLIB_BUILD_TESTING=ON -- Enable Zlib Examples as tests | ||
15 | |||
16 | ZLIB_BUILD_SHARED=ON -- Enable building zlib shared library | ||
17 | |||
18 | ZLIB_BUILD_STATIC=ON -- Enable building zlib static library | ||
19 | |||
20 | ZLIB_BUILD_MINIZIP=ON -- Enable building libminizip contrib library | ||
21 | |||
22 | If this option is turned on, additional options are available from minizip (see below) | ||
23 | |||
24 | ZLIB_INSTALL=ON -- Enable installation of zlib | ||
25 | |||
26 | ZLIB_PREFIX=OFF -- prefix for all types and library functions, see zconf.h.in | ||
27 | |||
28 | ZLIB_INSTALL_COMPAT_DLL=ON -- Install a copy as zlib1.dll | ||
29 | |||
30 | This option is only on windows available and may/will be turned off and removed somewhen in the future. | ||
31 | If you rely cmake for finding and using zlib, this can be turned off, as `zlib1.dll` will never be used. | ||
32 | |||
33 | ## minizip-options with defaults ## | ||
34 | |||
35 | MINIZIP_BUILD_SHARED=ON -- Enable building minizip shared library | ||
36 | |||
37 | MINIZIP_BUILD_STATIC=ON -- Enable building minizip static library | ||
38 | |||
39 | MINIZIP_BUILD_TESTING=ON -- Enable testing of minizip | ||
40 | |||
41 | MINIZIP_ENABLE_BZIP2=ON -- Build minizip withj bzip2 support | ||
42 | |||
43 | A usable installation of bzip2 is needed or config will fail. Turn this option of in this case. | ||
44 | |||
45 | MINIZIP_INSTALL=ON -- Enable installation of minizip | ||
46 | |||
47 | MINIZIP_INSTALL_COMPAT_DLL=ON -- Install a copy as libminizip-1.dll | ||
48 | |||
49 | This option is only available on mingw as they tend to name this lib different. Maybe this will also be | ||
50 | removed in the future as. If you rely cmake for finding and using zlib, this can be turned off, as | ||
51 | the other file will never be used. | ||
52 | |||
53 | ## Using the libs ## | ||
54 | |||
55 | To pull in what you need it's enough to just write | ||
56 | |||
57 | find_package(ZLIB CONFIG) | ||
58 | |||
59 | or | ||
60 | |||
61 | find_package(minizip CONFIG) | ||
62 | |||
63 | in your CMakeLists.txt, however it is advised to specify what you really want via: | ||
64 | |||
65 | find_package(ZLIB CONFIG COMPONENTS shared static REQUIRED) | ||
66 | |||
67 | or | ||
68 | |||
69 | find_package(minizip CONFIG COMPONENTS shared static REQUIRED) | ||
70 | |||
71 | As it's possible to only build the shared or the static lib, you can make sure that everything you need | ||
72 | is found. If no COMPONENTS are requested, everything that is found will satisfy your request. If the | ||
73 | libraries are optional in you project, you can omit the REQUIRED and check yourself if the targets you | ||
74 | want to link against are created. | ||
75 | |||
76 | When you search for minizip, it will search zlib for you, so only one of both is needed. | ||
77 | |||
78 | ## Imported targets ## | ||
79 | |||
80 | When found the following targets are created for you: | ||
81 | |||
82 | ZLIB::ZLIB and ZLIB::ZLIBSTATIC -- for zlib | ||
83 | MINIZIP::minizip and MINIZIP::minizipstatic -- for minizip | ||
diff --git a/README.cmake b/README.cmake deleted file mode 100644 index 96d492c..0000000 --- a/README.cmake +++ /dev/null | |||
@@ -1,76 +0,0 @@ | |||
1 | For building with cmake at least version 3.10 (minizip 3.12) is needed | ||
2 | |||
3 | In most cases the usual "mkdir build && cd build && cmake .." will create everything you need, however | ||
4 | if you want something off default you can adjust several options fit your needs. Every option is | ||
5 | list below (excluding the cmake-standard options), they can be set via cmake-gui or on cmdline with | ||
6 | |||
7 | -D<option>=ON/OFF | ||
8 | |||
9 | ## ZLIB-options with defaults ## | ||
10 | |||
11 | ZLIB_BUILD_TESTING=ON -- Enable Zlib Examples as tests | ||
12 | |||
13 | ZLIB_BUILD_SHARED=ON -- Enable building zlib shared library | ||
14 | |||
15 | ZLIB_BUILD_STATIC=ON -- Enable building zlib static library | ||
16 | |||
17 | ZLIB_BUILD_MINIZIP=ON -- Enable building libminizip contrib library | ||
18 | If this option is turned on, additional options are available from minizip (see below) | ||
19 | |||
20 | ZLIB_INSTALL=ON -- Enable installation of zlib | ||
21 | |||
22 | ZLIB_PREFIX=OFF -- prefix for all types and library functions, see zconf.h.in | ||
23 | |||
24 | ZLIB_INSTALL_COMPAT_DLL=ON -- Install a copy as zlib1.dll | ||
25 | This option is only on windows available and may/will be turned off and removed somewhen in the future. | ||
26 | If you rely cmake for finding and using zlib, this can be turned off, as zlib1.dll will never be used. | ||
27 | |||
28 | ## minizip-options with defaults ## | ||
29 | |||
30 | MINIZIP_BUILD_SHARED=ON Enable building minizip shared library | ||
31 | |||
32 | MINIZIP_BUILD_STATIC=ON Enable building minizip static library | ||
33 | |||
34 | MINIZIP_BUILD_TESTING=ON Enable testing of minizip | ||
35 | |||
36 | MINIZIP_ENABLE_BZIP2=ON Build minizip withj bzip2 support | ||
37 | A usable installation of bzip2 is needed or config will fail. Turn this option of in this case. | ||
38 | |||
39 | MINIZIP_INSTALL=ON Enable installation of minizip | ||
40 | |||
41 | MINIZIP_INSTALL_COMPAT_DLL=ON Install a copy as libminizip-1.dll | ||
42 | This option is only available on mingw as they tend to name this lib different. Maybe this will also be | ||
43 | removed in the future as. If you rely cmake for finding and using zlib, this can be turned off, as | ||
44 | the other file will never be used. | ||
45 | |||
46 | ## Using the libs ## | ||
47 | |||
48 | To pull in what you need it's enough to just write | ||
49 | |||
50 | find_package(ZLIB CONFIG) | ||
51 | or | ||
52 | find_package(minizip CONFIG) | ||
53 | |||
54 | in your CMakeLists.txt, however it is advised to specify what you really want via: | ||
55 | |||
56 | find_package(ZLIB CONFIG COMPONENTS shared static REQUIRED) | ||
57 | or | ||
58 | find_package(minizip CONFIG COMPONENTS shared static REQUIRED) | ||
59 | |||
60 | As it's possible to only build the shared or the static lib, you can make sure that everything you need | ||
61 | is found. If no COMPONENTS are requested, everything that is found will satisfy your request. If the | ||
62 | libraries are optional in you project, you can omit the REQUIRED and check yourself if the targets you | ||
63 | want to link against are created. | ||
64 | |||
65 | When you search for minizip, it will search zlib for you, so only one of both is needed. | ||
66 | |||
67 | ## Imported targets ## | ||
68 | When found the following targets are created for you: | ||
69 | |||
70 | ZLIB::ZLIB and ZLIB:ZLIBSTATIC for zlib | ||
71 | MINIZIP::minizip and MINIZIP::minizipstatic for minizip | ||
72 | |||
73 | In addition a var called MINIZIP_ENABLE_BZIP2 is exported so you can check if you got a bzip2 enabled | ||
74 | version of the lib. As linking against libbz2 is only needed if you use functions from that set, it's | ||
75 | no hard dep and you have to make sure a working bzip2-installation is found and linked in your binary. | ||
76 | |||