fast_excel 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/.travis.yml +4 -0
- data/CHANGELOG.md +9 -0
- data/Gemfile.lock +16 -16
- data/README.md +1 -1
- data/Rakefile +1 -1
- data/fast_excel.gemspec +1 -1
- data/lib/fast_excel.rb +21 -5
- data/lib/fast_excel/binding/format.rb +3 -3
- data/libxlsxwriter/.drone.yml +27 -0
- data/libxlsxwriter/.indent.pro +3 -0
- data/libxlsxwriter/.travis.yml +12 -0
- data/libxlsxwriter/CMakeLists.txt +348 -0
- data/libxlsxwriter/Changes.txt +78 -0
- data/libxlsxwriter/LICENSE.txt +65 -4
- data/libxlsxwriter/Makefile +27 -7
- data/libxlsxwriter/Readme.md +2 -0
- data/libxlsxwriter/appveyor.yml +65 -0
- data/libxlsxwriter/cmake/FindMINIZIP.cmake +121 -0
- data/libxlsxwriter/cmake/FindPackage.cmake +183 -0
- data/libxlsxwriter/cmake/FindZLIB.cmake +123 -0
- data/libxlsxwriter/cmake/i686-toolchain.cmake +7 -0
- data/libxlsxwriter/cocoapods/libxlsxwriter-umbrella.h +1 -1
- data/libxlsxwriter/cocoapods/libxlsxwriter.modulemap +2 -2
- data/libxlsxwriter/include/xlsxwriter.h +2 -2
- data/libxlsxwriter/include/xlsxwriter/app.h +1 -1
- data/libxlsxwriter/include/xlsxwriter/chart.h +109 -8
- data/libxlsxwriter/include/xlsxwriter/common.h +10 -2
- data/libxlsxwriter/include/xlsxwriter/content_types.h +1 -1
- data/libxlsxwriter/include/xlsxwriter/core.h +1 -1
- data/libxlsxwriter/include/xlsxwriter/custom.h +1 -1
- data/libxlsxwriter/include/xlsxwriter/drawing.h +1 -1
- data/libxlsxwriter/include/xlsxwriter/format.h +6 -6
- data/libxlsxwriter/include/xlsxwriter/hash_table.h +1 -1
- data/libxlsxwriter/include/xlsxwriter/packager.h +6 -1
- data/libxlsxwriter/include/xlsxwriter/relationships.h +1 -1
- data/libxlsxwriter/include/xlsxwriter/shared_strings.h +1 -1
- data/libxlsxwriter/include/xlsxwriter/styles.h +2 -2
- data/libxlsxwriter/include/xlsxwriter/theme.h +1 -1
- data/libxlsxwriter/include/xlsxwriter/utility.h +11 -5
- data/libxlsxwriter/include/xlsxwriter/workbook.h +3 -3
- data/libxlsxwriter/include/xlsxwriter/worksheet.h +517 -39
- data/libxlsxwriter/include/xlsxwriter/xmlwriter.h +2 -2
- data/libxlsxwriter/libxlsxwriter.podspec +4 -2
- data/libxlsxwriter/src/Makefile +30 -5
- data/libxlsxwriter/src/app.c +1 -1
- data/libxlsxwriter/src/chart.c +76 -19
- data/libxlsxwriter/src/content_types.c +1 -1
- data/libxlsxwriter/src/core.c +10 -10
- data/libxlsxwriter/src/custom.c +2 -2
- data/libxlsxwriter/src/drawing.c +1 -1
- data/libxlsxwriter/src/format.c +3 -3
- data/libxlsxwriter/src/hash_table.c +1 -1
- data/libxlsxwriter/src/packager.c +20 -7
- data/libxlsxwriter/src/relationships.c +1 -1
- data/libxlsxwriter/src/shared_strings.c +1 -1
- data/libxlsxwriter/src/styles.c +4 -4
- data/libxlsxwriter/src/theme.c +1 -1
- data/libxlsxwriter/src/utility.c +41 -1
- data/libxlsxwriter/src/workbook.c +8 -6
- data/libxlsxwriter/src/worksheet.c +748 -31
- data/libxlsxwriter/src/xmlwriter.c +2 -2
- data/libxlsxwriter/third_party/minizip/Makefile +6 -1
- data/libxlsxwriter/version.txt +1 -1
- data/test/reopen_test.rb +22 -0
- data/test/test_helper.rb +8 -5
- data/test/validations_test.rb +27 -0
- metadata +11 -2
data/libxlsxwriter/Changes.txt
CHANGED
@@ -2,6 +2,84 @@
|
|
2
2
|
@page changes Changes
|
3
3
|
|
4
4
|
|
5
|
+
## 0.7.7 May 16 2018
|
6
|
+
|
7
|
+
- Fix to ensure the use of wide filenames on Windows with Microsoft Visual
|
8
|
+
C++.
|
9
|
+
Issue [#153][gh_153].
|
10
|
+
|
11
|
+
[gh_153]: https://github.com/jmcnamara/libxlsxwriter/issues/153
|
12
|
+
|
13
|
+
- Added docs on building an app with Cmake and Microsoft Visual C++ on
|
14
|
+
Windows. See @ref gsg_cmake_app.
|
15
|
+
|
16
|
+
|
17
|
+
## 0.7.6 January 11 2018
|
18
|
+
|
19
|
+
- Added support for worksheet Grouping and Outlines.
|
20
|
+
See @ref working_with_outlines.
|
21
|
+
Feature request [#30][gh_30].
|
22
|
+
|
23
|
+
[gh_30]: https://github.com/jmcnamara/libxlsxwriter/issues/30
|
24
|
+
|
25
|
+
- Fix include of libxlsxwriter as a Cocoapod on macOS.
|
26
|
+
Issue [#94][gh_94].
|
27
|
+
|
28
|
+
[gh_94]: https://github.com/jmcnamara/libxlsxwriter/issues/94
|
29
|
+
|
30
|
+
|
31
|
+
## 0.7.5 September 25 2017
|
32
|
+
|
33
|
+
- Added support for data validations and dropdown lists. See @ref
|
34
|
+
working_with_data_validation and @ref data_validate.c.
|
35
|
+
Feature request [#31][gh_31].
|
36
|
+
|
37
|
+
[gh_31]: https://github.com/jmcnamara/libxlsxwriter/issues/31
|
38
|
+
|
39
|
+
|
40
|
+
## 0.7.4 August 20 2017
|
41
|
+
|
42
|
+
- Fix make build system "install" target for compatibility with macOS
|
43
|
+
[brew/homebrew](https://brew.sh) installer. See @ref gsg_brew.
|
44
|
+
|
45
|
+
|
46
|
+
## 0.7.3 August 12 2017
|
47
|
+
|
48
|
+
|
49
|
+
- Build system fixes for Gentoo.
|
50
|
+
Issue [#116][gh_116].
|
51
|
+
|
52
|
+
[gh_116]: https://github.com/jmcnamara/libxlsxwriter/issues/116
|
53
|
+
|
54
|
+
|
55
|
+
## 0.7.2 July 26 2017
|
56
|
+
|
57
|
+
- Changed font sizes from integer to double to allow fractional font sizes.
|
58
|
+
Issue [#114][gh_114].
|
59
|
+
|
60
|
+
[gh_114]: https://github.com/jmcnamara/libxlsxwriter/issues/114
|
61
|
+
|
62
|
+
|
63
|
+
## 0.7.1 July 24 2017
|
64
|
+
|
65
|
+
- Fixed issue where internal file creation and modification dates were in the
|
66
|
+
local timezone instead of UTC.
|
67
|
+
Issue [#110][gh_110].
|
68
|
+
|
69
|
+
[gh_110]: https://github.com/jmcnamara/libxlsxwriter/issues/110
|
70
|
+
|
71
|
+
|
72
|
+
## 0.7.0 June 26 2017
|
73
|
+
|
74
|
+
- Added support for CMake build system. See @ref gsg_cmake.
|
75
|
+
Thanks to Alex Huszagh.
|
76
|
+
|
77
|
+
- Fixed issue where image filehandles weren't closed until the overall file
|
78
|
+
was closed causing the system to run out of filehandles.
|
79
|
+
Issue [#106][gh_106].
|
80
|
+
|
81
|
+
[gh_106]: https://github.com/jmcnamara/libxlsxwriter/issues/106
|
82
|
+
|
5
83
|
## 0.6.9 January 30 2017
|
6
84
|
|
7
85
|
- Added chart trendlines. See @ref chart_trendlines and
|
data/libxlsxwriter/LICENSE.txt
CHANGED
@@ -1,7 +1,10 @@
|
|
1
|
+
/**
|
2
|
+
|
3
|
+
@page license License
|
1
4
|
|
2
5
|
Libxlsxwriter is released under a FreeBSD license:
|
3
6
|
|
4
|
-
Copyright 2014-
|
7
|
+
Copyright 2014-2018, John McNamara <jmcnamara@cpan.org>
|
5
8
|
All rights reserved.
|
6
9
|
|
7
10
|
Redistribution and use in source and binary forms, with or without
|
@@ -31,8 +34,8 @@ Libxlsxwriter is released under a FreeBSD license:
|
|
31
34
|
official policies, either expressed or implied, of the FreeBSD Project.
|
32
35
|
|
33
36
|
|
34
|
-
Libxlsxwriter includes `queue.h` from FreeBSD
|
35
|
-
`zlib` which have the following licenses:
|
37
|
+
Libxlsxwriter includes `queue.h` and `tree.h` from FreeBSD, the `minizip`
|
38
|
+
component of `zlib` and `tmpfileplus` which have the following licenses:
|
36
39
|
|
37
40
|
|
38
41
|
Queue.h from FreeBSD:
|
@@ -65,7 +68,35 @@ Queue.h from FreeBSD:
|
|
65
68
|
SUCH DAMAGE.
|
66
69
|
|
67
70
|
|
68
|
-
|
71
|
+
Tree.h from FreeBSD:
|
72
|
+
|
73
|
+
Copyright 2002 Niels Provos <provos@citi.umich.edu>
|
74
|
+
All rights reserved.
|
75
|
+
|
76
|
+
Redistribution and use in source and binary forms, with or without
|
77
|
+
modification, are permitted provided that the following conditions
|
78
|
+
are met:
|
79
|
+
1. Redistributions of source code must retain the above copyright
|
80
|
+
notice, this list of conditions and the following disclaimer.
|
81
|
+
2. Redistributions in binary form must reproduce the above copyright
|
82
|
+
notice, this list of conditions and the following disclaimer in the
|
83
|
+
documentation and/or other materials provided with the distribution.
|
84
|
+
|
85
|
+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
86
|
+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
87
|
+
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
88
|
+
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
89
|
+
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
90
|
+
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
91
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
92
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
93
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
94
|
+
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
95
|
+
|
96
|
+
|
97
|
+
The `minizip` files used in the libxlsxwriter source tree are taken from the
|
98
|
+
`zlib` ` contrib/minizip` directory. [Zlib](http://www.zlib.net) has the
|
99
|
+
following License/Copyright:
|
69
100
|
|
70
101
|
(C) 1995-2013 Jean-loup Gailly and Mark Adler
|
71
102
|
|
@@ -87,3 +118,33 @@ Zlib has the following License/Copyright:
|
|
87
118
|
|
88
119
|
Jean-loup Gailly Mark Adler
|
89
120
|
jloup@gzip.org madler@alumni.caltech.edu
|
121
|
+
|
122
|
+
The `minizip` files have the following additional copyright declarations:
|
123
|
+
|
124
|
+
Copyright (C) 1998-2010 Gilles Vollant
|
125
|
+
(minizip) ( http://www.winimage.com/zLibDll/minizip.html )
|
126
|
+
|
127
|
+
Modifications for Zip64 support
|
128
|
+
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
|
129
|
+
|
130
|
+
Note, it is possible to compile libxlsxwriter without statically linking the
|
131
|
+
`minizip` files and instead dynamically linking to `lminizip`, see
|
132
|
+
@ref gsg_minizip.
|
133
|
+
|
134
|
+
[Tmpfileplus](http://www.di-mgt.com.au/c_function_to_create_temp_file.html)
|
135
|
+
has the following license:
|
136
|
+
|
137
|
+
This Source Code Form is subject to the terms of the Mozilla Public
|
138
|
+
License, v. 2.0. If a copy of the MPL was not distributed with this
|
139
|
+
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
140
|
+
|
141
|
+
Copyright (c) 2012-16 David Ireland, DI Management Services Pty Ltd
|
142
|
+
<http://www.di-mgt.com.au/contact/>.
|
143
|
+
|
144
|
+
See the [Mozilla Public License, v. 2.0](http://mozilla.org/MPL/2.0/).
|
145
|
+
|
146
|
+
Note, it is possible to compile libxlsxwriter using the standard library
|
147
|
+
`tmpfile()` function instead of `tmpfileplus`, see @ref gsg_tmpdir.
|
148
|
+
|
149
|
+
Next: @ref changes
|
150
|
+
*/
|
data/libxlsxwriter/Makefile
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
#
|
3
3
|
# Makefile for libxlsxwriter library.
|
4
4
|
#
|
5
|
-
# Copyright 2014-
|
5
|
+
# Copyright 2014-2018, John McNamara, jmcnamara@cpan.org
|
6
6
|
#
|
7
7
|
|
8
8
|
# Keep the output quiet by default.
|
@@ -11,11 +11,15 @@ ifdef V
|
|
11
11
|
Q=
|
12
12
|
endif
|
13
13
|
|
14
|
+
INSTALL_DIR ?= /usr/local
|
15
|
+
|
14
16
|
.PHONY: docs tags examples
|
15
17
|
|
16
18
|
# Build the libs.
|
17
19
|
all :
|
20
|
+
ifndef USE_SYSTEM_MINIZIP
|
18
21
|
$(Q)$(MAKE) -C third_party/minizip
|
22
|
+
endif
|
19
23
|
ifndef USE_STANDARD_TMPFILE
|
20
24
|
$(Q)$(MAKE) -C third_party/tmpfileplus
|
21
25
|
endif
|
@@ -31,11 +35,13 @@ clean :
|
|
31
35
|
$(Q)$(MAKE) clean -C test/unit
|
32
36
|
$(Q)$(MAKE) clean -C test/functional/src
|
33
37
|
$(Q)$(MAKE) clean -C examples
|
34
|
-
$(Q)$(MAKE) clean -C third_party/minizip
|
35
38
|
$(Q)rm -rf docs/html
|
36
39
|
$(Q)rm -rf test/functional/__pycache__
|
37
40
|
$(Q)rm -f test/functional/*.pyc
|
38
41
|
$(Q)rm -f lib/*
|
42
|
+
ifndef USE_STANDARD_TMPFILE
|
43
|
+
$(Q)$(MAKE) clean -C third_party/minizip
|
44
|
+
endif
|
39
45
|
ifndef USE_STANDARD_TMPFILE
|
40
46
|
$(Q)$(MAKE) clean -C third_party/tmpfileplus
|
41
47
|
endif
|
@@ -43,6 +49,12 @@ endif
|
|
43
49
|
# Run the unit tests.
|
44
50
|
test : all test_functional test_unit
|
45
51
|
|
52
|
+
# Test for C++ const correctness on APIs.
|
53
|
+
test_const : all
|
54
|
+
$(Q)$(MAKE) clean -C test/functional/src
|
55
|
+
$(Q)! $(MAKE) -C test/functional/src CFLAGS=-Wwrite-strings 2>&1 | grep -A 1 "note:"
|
56
|
+
|
57
|
+
|
46
58
|
# Run the functional tests.
|
47
59
|
test_functional : all
|
48
60
|
$(Q)$(MAKE) -C test/functional/src
|
@@ -51,7 +63,9 @@ test_functional : all
|
|
51
63
|
# Run all tests.
|
52
64
|
test_unit :
|
53
65
|
@echo "Compiling unit tests ..."
|
66
|
+
ifndef USE_SYSTEM_MINIZIP
|
54
67
|
$(Q)$(MAKE) -C third_party/minizip
|
68
|
+
endif
|
55
69
|
ifndef USE_STANDARD_TMPFILE
|
56
70
|
$(Q)$(MAKE) -C third_party/tmpfileplus
|
57
71
|
endif
|
@@ -83,14 +97,16 @@ docs:
|
|
83
97
|
$(Q)$(MAKE) -C docs
|
84
98
|
|
85
99
|
# Simple minded install.
|
86
|
-
install:
|
87
|
-
$(Q)
|
88
|
-
$(Q)cp
|
100
|
+
install: all
|
101
|
+
$(Q)mkdir -p $(INSTALL_DIR)/include
|
102
|
+
$(Q)cp -R include/* $(INSTALL_DIR)/include
|
103
|
+
$(Q)mkdir -p $(INSTALL_DIR)/lib
|
104
|
+
$(Q)cp lib/* $(INSTALL_DIR)/lib
|
89
105
|
|
90
106
|
# Simpler minded uninstall.
|
91
107
|
uninstall:
|
92
|
-
$(Q)rm -rf /
|
93
|
-
$(Q)rm
|
108
|
+
$(Q)rm -rf $(INSTALL_DIR)/include/xlsxwriter*
|
109
|
+
$(Q)rm $(INSTALL_DIR)/lib/libxlsxwriter.*
|
94
110
|
|
95
111
|
# Strip the lib files.
|
96
112
|
strip:
|
@@ -98,7 +114,9 @@ strip:
|
|
98
114
|
|
99
115
|
# Run a coverity static analysis.
|
100
116
|
coverity:
|
117
|
+
ifndef USE_SYSTEM_MINIZIP
|
101
118
|
$(Q)$(MAKE) -C third_party/minizip
|
119
|
+
endif
|
102
120
|
ifndef USE_STANDARD_TMPFILE
|
103
121
|
$(Q)$(MAKE) -C third_party/tmpfileplus
|
104
122
|
endif
|
@@ -113,7 +131,9 @@ endif
|
|
113
131
|
|
114
132
|
# Run a scan-build static analysis.
|
115
133
|
scan_build:
|
134
|
+
ifndef USE_SYSTEM_MINIZIP
|
116
135
|
$(Q)$(MAKE) -C third_party/minizip
|
136
|
+
endif
|
117
137
|
ifndef USE_STANDARD_TMPFILE
|
118
138
|
$(Q)$(MAKE) -C third_party/tmpfileplus
|
119
139
|
endif
|
data/libxlsxwriter/Readme.md
CHANGED
@@ -20,6 +20,7 @@ It supports features such as:
|
|
20
20
|
- Defined names.
|
21
21
|
- Autofilters.
|
22
22
|
- Charts.
|
23
|
+
- Data validation and drop down lists.
|
23
24
|
- Worksheet PNG/JPEG images.
|
24
25
|
- Memory optimization mode for writing large files.
|
25
26
|
- Source code available on [GitHub](https://github.com/jmcnamara/libxlsxwriter).
|
@@ -28,6 +29,7 @@ It supports features such as:
|
|
28
29
|
- Works with GCC, Clang, Xcode, MSVC 2015, ICC, TCC, MinGW, MingGW-w64/32.
|
29
30
|
- Works on Linux, FreeBSD, OpenBSD, OS X, iOS and Windows. Also works on MSYS/MSYS2 and Cygwin.
|
30
31
|
- Compiles for 32 and 64 bit.
|
32
|
+
- Compiles and works on big and little endian systems.
|
31
33
|
- The only dependency is on `zlib`.
|
32
34
|
|
33
35
|
Here is an example that was used to create the spreadsheet shown above:
|
@@ -0,0 +1,65 @@
|
|
1
|
+
version: '{build}'
|
2
|
+
|
3
|
+
clone_depth: 1
|
4
|
+
|
5
|
+
platform:
|
6
|
+
- x64
|
7
|
+
- x86
|
8
|
+
|
9
|
+
os:
|
10
|
+
- Visual Studio 2015
|
11
|
+
- Visual Studio 2017
|
12
|
+
|
13
|
+
environment:
|
14
|
+
matrix:
|
15
|
+
- additional_flags: ""
|
16
|
+
STATIC: ON
|
17
|
+
ZLIB_LIB: zlibstatic
|
18
|
+
|
19
|
+
- additional_flags: "/std:c++latest"
|
20
|
+
STATIC: ON
|
21
|
+
ZLIB_LIB: zlibstatic
|
22
|
+
|
23
|
+
- additional_flags: ""
|
24
|
+
STATIC: OFF
|
25
|
+
ZLIB_LIB: zlib
|
26
|
+
|
27
|
+
- additional_flags: "/std:c++latest"
|
28
|
+
STATIC: OFF
|
29
|
+
ZLIB_LIB: zlib
|
30
|
+
|
31
|
+
matrix:
|
32
|
+
fast_finish: true
|
33
|
+
exclude:
|
34
|
+
- additional_flags: "/std:c++latest"
|
35
|
+
os: Visual Studio 2015
|
36
|
+
|
37
|
+
configuration:
|
38
|
+
#- Debug
|
39
|
+
- Release
|
40
|
+
|
41
|
+
init: []
|
42
|
+
|
43
|
+
install: []
|
44
|
+
|
45
|
+
build_script:
|
46
|
+
# Set the correct generator
|
47
|
+
- IF "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2015" ( SET GEN="Visual Studio 14 2015") ELSE (SET GEN="Visual Studio 15 2017")
|
48
|
+
# ZLIB isn't included on Windows, and no package manager has a static,
|
49
|
+
# /MT-linked build, so we can download it and build it ourselves
|
50
|
+
- appveyor DownloadFile http://zlib.net/zlib-1.2.11.tar.gz -FileName zlib-1.2.11.tar.gz
|
51
|
+
- 7z x zlib-1.2.11.tar.gz > NUL
|
52
|
+
- 7z x zlib-1.2.11.tar > NUL
|
53
|
+
- cd zlib-1.2.11
|
54
|
+
- cmake -G %GEN% -DCMAKE_BUILD_TYPE=%configuration% -DCMAKE_C_FLAGS_RELEASE="/MT"
|
55
|
+
- cmake --build . --config %configuration%
|
56
|
+
# Configure libxlsxwriter to use the static ZLIB
|
57
|
+
- cd ..
|
58
|
+
- cmake . -G%GEN% -DCMAKE_BUILD_TYPE=%configuration% -DCMAKE_C_FLAGS_RELEASE="/MT" -DBUILD_STATIC=%STATIC% -DBUILD_TESTS=ON -DZLIB_LIBRARY=%APPVEYOR_BUILD_FOLDER%\zlib-1.2.11\Release\%ZLIB_LIB%.lib -DZLIB_INCLUDE_DIR=%APPVEYOR_BUILD_FOLDER%\zlib-1.2.11
|
59
|
+
- cmake --build . --config %configuration% --target install
|
60
|
+
|
61
|
+
test_script:
|
62
|
+
# Currently disable tests for MSVC: There's an issue with the test runner, not the library.
|
63
|
+
# All the examples work properly.
|
64
|
+
# - IF "%STATIC%" == OFF ( copy %APPVEYOR_BUILD_FOLDER%\zlib-1.2.11\Release\%ZLIB_LIB%.dll %APPVEYOR_BUILD_FOLDER%\%configuration%\%ZLIB_LIB%.dll )
|
65
|
+
- IF %STATIC% == ON ( ctest -C %configuration% -V )
|
@@ -0,0 +1,121 @@
|
|
1
|
+
# :copyright: (c) 2017 Alex Huszagh.
|
2
|
+
# :license: FreeBSD, see LICENSE.txt for more details.
|
3
|
+
|
4
|
+
# FindMINIZIP
|
5
|
+
# -----------
|
6
|
+
#
|
7
|
+
# Find MINIZIP include dirs and libraries
|
8
|
+
#
|
9
|
+
# Use this module by invoking find_package with the form::
|
10
|
+
#
|
11
|
+
# find_package(MINIZIP
|
12
|
+
# [version] [EXACT] # Minimum or EXACT version e.g. 1.0.6
|
13
|
+
# [REQUIRED] # Fail with error if MINIZIP is not found
|
14
|
+
# )
|
15
|
+
#
|
16
|
+
# You may also set `MINIZIP_USE_STATIC_LIBS` to prefer static libraries
|
17
|
+
# to shared ones.
|
18
|
+
#
|
19
|
+
# If found, `MINIZIP_FOUND` will be set to true, and `MINIZIP_LIBRARIES`
|
20
|
+
# and `MINIZIP_INCLUDE_DIRS` will both be set.
|
21
|
+
#
|
22
|
+
# You may optionally set `MINIZIP_ROOT` to specify a custom root directory
|
23
|
+
# for the MINIZIP installation.
|
24
|
+
#
|
25
|
+
|
26
|
+
include(CheckCXXSourceCompiles)
|
27
|
+
include(FindPackage)
|
28
|
+
|
29
|
+
# PATHS
|
30
|
+
# -----
|
31
|
+
|
32
|
+
set(MINIZIP_SEARCH_PATHS)
|
33
|
+
|
34
|
+
if(MINIZIP_ROOT)
|
35
|
+
list(APPEND MINIZIP_SEARCH_PATHS ${MINIZIP_ROOT})
|
36
|
+
endif()
|
37
|
+
|
38
|
+
if(WIN32)
|
39
|
+
list(APPEND ZLIB_SEARCH_PATHS
|
40
|
+
"$ENV{PROGRAMFILES}/minizip"
|
41
|
+
)
|
42
|
+
endif()
|
43
|
+
|
44
|
+
unset(MINIZIP_SYSTEM_ROOT)
|
45
|
+
unset(MINIZIP_CUSTOM_ROOT)
|
46
|
+
unset(MINIZIP_SEARCH_HKEY)
|
47
|
+
|
48
|
+
# FIND
|
49
|
+
# ----
|
50
|
+
|
51
|
+
# INCLUDE DIRECTORY
|
52
|
+
SetSuffixes(MINIZIP)
|
53
|
+
foreach(search ${MINIZIP_SEARCH_PATHS})
|
54
|
+
FIND_PATH(MINIZIP_INCLUDE_DIR
|
55
|
+
NAMES minizip/zip.h
|
56
|
+
PATHS ${search}
|
57
|
+
PATH_SUFFIXES include
|
58
|
+
)
|
59
|
+
endforeach(search)
|
60
|
+
|
61
|
+
if(NOT MINIZIP_INCLUDE_DIR)
|
62
|
+
FIND_PATH(MINIZIP_INCLUDE_DIR minizip/zip.h PATH_SUFFIXES include)
|
63
|
+
endif()
|
64
|
+
|
65
|
+
# LIBRARY PATHS
|
66
|
+
set(MINIZIP_LIBRARY_NAMES minizip)
|
67
|
+
if(CMAKE_BUILD_TYPE MATCHES Debug)
|
68
|
+
list(APPEND MINIZIP_LIBRARY_NAMES minizipd)
|
69
|
+
endif()
|
70
|
+
|
71
|
+
foreach(search ${MINIZIP_SEARCH_PATHS})
|
72
|
+
FIND_LIBRARY(MINIZIP_LIBRARY
|
73
|
+
NAMES ${MINIZIP_LIBRARY_NAMES}
|
74
|
+
PATHS ${search}
|
75
|
+
PATH_SUFFIXES lib
|
76
|
+
)
|
77
|
+
endforeach(search)
|
78
|
+
|
79
|
+
if(NOT MINIZIP_LIBRARY)
|
80
|
+
FIND_LIBRARY(MINIZIP_LIBRARY NAMES ${MINIZIP_LIBRARY_NAMES} PATH_SUFFIXES lib)
|
81
|
+
endif()
|
82
|
+
|
83
|
+
set(MINIZIP_INCLUDE_DIRS ${MINIZIP_INCLUDE_DIR})
|
84
|
+
set(MINIZIP_LIBRARIES ${MINIZIP_LIBRARY})
|
85
|
+
|
86
|
+
CheckFound(MINIZIP)
|
87
|
+
FindStaticLibs(MINIZIP)
|
88
|
+
|
89
|
+
# VERSION
|
90
|
+
# -------
|
91
|
+
|
92
|
+
if(MINIZIP_FOUND)
|
93
|
+
file(STRINGS "${MINIZIP_INCLUDE_DIRS}/zlib.h" MINIZIP_VERSION_CONTENTS REGEX "Version [0-9]+\\.[0-9]+(\\.[0-9]+)?")
|
94
|
+
string(REGEX REPLACE ".*Version ([0-9]+)\\.[0-9]+" "\\1" MINIZIP_VERSION_MAJOR "${MINIZIP_VERSION_CONTENTS}")
|
95
|
+
string(REGEX REPLACE ".*Version [0-9]+\\.([0-9]+)" "\\1" MINIZIP_VERSION_MINOR "${MINIZIP_VERSION_CONTENTS}")
|
96
|
+
set(MINIZIP_VERSION_PATCH 0)
|
97
|
+
|
98
|
+
set(MINIZIP_VERSION_STRING "${MINIZIP_VERSION_MAJOR}.${MINIZIP_VERSION_MINOR}.${MINIZIP_VERSION_PATCH}")
|
99
|
+
set(MINIZIP_VERSION ${MINIZIP_VERSION_STRING})
|
100
|
+
|
101
|
+
MatchVersion(MINIZIP)
|
102
|
+
endif()
|
103
|
+
|
104
|
+
# COMPILATION
|
105
|
+
# -----------
|
106
|
+
|
107
|
+
set(MINIZIP_CODE "
|
108
|
+
#include <minizip/zip.h>
|
109
|
+
int main(void)
|
110
|
+
{
|
111
|
+
zip_fileinfo zipfile_info;
|
112
|
+
|
113
|
+
return 0;
|
114
|
+
}
|
115
|
+
"
|
116
|
+
)
|
117
|
+
|
118
|
+
if(MINIZIP_FOUND)
|
119
|
+
CheckCompiles(MINIZIP)
|
120
|
+
endif()
|
121
|
+
RequiredPackageFound(MINIZIP)
|