casadi 3.6.7__cp37-none-manylinux2014_aarch64.whl → 3.7.1__cp37-none-manylinux2014_aarch64.whl
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.
- casadi/_casadi.so +0 -0
- casadi/casadi-cli +0 -0
- casadi/casadi.py +6531 -3039
- casadi/cmake/casadi-config-version.cmake +1 -1
- casadi/cmake/casadi-config.cmake +1 -1
- casadi/cmake/casadi-targets-release.cmake +5 -5
- casadi/cmake/casadi-targets.cmake +5 -5
- casadi/{lib/cmake/tinyxml2/tinyxml2-config-version.cmake → cmake/ghc_filesystem/ghc_filesystem-config-version.cmake} +30 -10
- casadi/cmake/ghc_filesystem/ghc_filesystem-config.cmake +30 -0
- casadi/cmake/ghc_filesystem/ghc_filesystem-targets.cmake +107 -0
- casadi/cmake/libzip/libzip-config-version.cmake +43 -0
- casadi/cmake/libzip/libzip-config.cmake +69 -0
- casadi/cmake/libzip/libzip-targets-release.cmake +19 -0
- casadi/{lib/cmake/tinyxml2/tinyxml2-static-targets.cmake → cmake/libzip/libzip-targets.cmake} +11 -7
- casadi/cmake/libzip/modules/FindMbedTLS.cmake +141 -0
- casadi/cmake/libzip/modules/FindNettle.cmake +141 -0
- casadi/cmake/libzip/modules/Findzstd.cmake +186 -0
- casadi/include/casadi/casadi.i +276 -47
- casadi/include/casadi/config.h +11 -11
- casadi/include/casadi/core/archiver.hpp +58 -0
- casadi/include/casadi/core/blazing_spline.hpp +47 -0
- casadi/include/casadi/core/calculus.hpp +57 -2
- casadi/include/casadi/core/callback.hpp +9 -0
- casadi/include/casadi/core/casadi_common.hpp +37 -0
- casadi/include/casadi/core/casadi_meta.hpp +15 -0
- casadi/include/casadi/core/casadi_misc.hpp +21 -0
- casadi/include/casadi/core/code_generator.hpp +115 -19
- casadi/include/casadi/core/core.hpp +5 -0
- casadi/include/casadi/core/dae_builder.hpp +303 -141
- casadi/include/casadi/core/dm.hpp +3 -0
- casadi/include/casadi/core/filesystem.hpp +58 -0
- casadi/include/casadi/core/fmu.hpp +62 -16
- casadi/include/casadi/core/function.hpp +24 -0
- casadi/include/casadi/core/generic_matrix.hpp +214 -7
- casadi/include/casadi/core/generic_shared.hpp +395 -0
- casadi/include/casadi/core/generic_shared_impl.hpp +218 -0
- casadi/include/casadi/core/generic_shared_internal.hpp +215 -0
- casadi/include/casadi/core/generic_type.hpp +3 -0
- casadi/include/casadi/core/global_options.hpp +10 -0
- casadi/include/casadi/core/integrator.hpp +41 -7
- casadi/include/casadi/core/matrix_decl.hpp +71 -0
- casadi/include/casadi/core/mx.hpp +63 -2
- casadi/include/casadi/core/nlp_builder.hpp +2 -1
- casadi/include/casadi/core/options.hpp +6 -3
- casadi/include/casadi/core/optistack.hpp +43 -9
- casadi/include/casadi/core/printable.hpp +8 -0
- casadi/include/casadi/core/resource.hpp +107 -0
- casadi/include/casadi/core/runtime/casadi_blazing_1d_boor_eval.hpp +112 -0
- casadi/include/casadi/core/runtime/casadi_blazing_2d_boor_eval.hpp +311 -0
- casadi/include/casadi/core/runtime/casadi_blazing_3d_boor_eval.hpp +645 -0
- casadi/include/casadi/core/runtime/casadi_blazing_de_boor.hpp +101 -0
- casadi/include/casadi/core/runtime/casadi_finite_diff.hpp +1 -1
- casadi/include/casadi/core/runtime/casadi_nlp.hpp +8 -2
- casadi/include/casadi/core/runtime/casadi_print_canonical.hpp +55 -0
- casadi/include/casadi/core/runtime/casadi_print_scalar.hpp +25 -0
- casadi/include/casadi/core/runtime/casadi_print_vector.hpp +32 -0
- casadi/include/casadi/core/runtime/casadi_printme.hpp +26 -0
- casadi/include/casadi/core/serializer.hpp +13 -5
- casadi/include/casadi/core/serializing_stream.hpp +9 -2
- casadi/include/casadi/core/shared_object.hpp +73 -161
- casadi/include/casadi/core/sparsity.hpp +13 -1
- casadi/include/casadi/core/sparsity_interface.hpp +19 -1
- casadi/include/casadi/core/sx.hpp +41 -0
- casadi/include/casadi/core/sx_elem.hpp +25 -0
- casadi/include/casadi/core/xml_node.hpp +5 -0
- casadi/include/casadi/doc.i +10026 -6513
- casadi/include/casadi/doc_merged.i +6744 -4449
- casadi/include/casadi/valgrind-casadi.supp +138 -0
- casadi/include/casadi/valgrind-python.supp +2470 -0
- casadi/include/fatrop/blasfeo_wrapper/LinearAlgebraBlasfeo.hpp +4 -1
- casadi/include/ghc/filesystem.hpp +6083 -0
- casadi/include/ghc/fs_fwd.hpp +38 -0
- casadi/include/ghc/fs_impl.hpp +35 -0
- casadi/include/ghc/fs_std.hpp +60 -0
- casadi/include/ghc/fs_std_fwd.hpp +63 -0
- casadi/include/ghc/fs_std_impl.hpp +46 -0
- casadi/include/licenses/ghc-external/LICENSE +19 -0
- casadi/include/licenses/libz-external/LICENSE +22 -0
- casadi/include/licenses/libz-external/contrib/dotzlib/LICENSE_1_0.txt +23 -0
- casadi/include/licenses/libzip-external/LICENSE +31 -0
- casadi/include/zconf.h +545 -0
- casadi/include/zip.h +528 -0
- casadi/include/zipconf.h +48 -0
- casadi/include/zlib.h +1938 -0
- casadi/libcasadi-tp-openblas.so +0 -0
- casadi/libcasadi-tp-openblas.so.0 +0 -0
- casadi/libcasadi-tp-openblas.so.0.3 +0 -0
- casadi/libcasadi.so +0 -0
- casadi/libcasadi.so.3.7 +0 -0
- casadi/libcasadi_archiver_libzip.so +0 -0
- casadi/libcasadi_archiver_libzip.so.3.7 +0 -0
- casadi/libcasadi_conic_cplex.so +0 -0
- casadi/libcasadi_conic_cplex.so.3.7 +0 -0
- casadi/libcasadi_conic_daqp.so +0 -0
- casadi/libcasadi_conic_daqp.so.3.7 +0 -0
- casadi/libcasadi_conic_fatrop.so +0 -0
- casadi/libcasadi_conic_fatrop.so.3.7 +0 -0
- casadi/libcasadi_conic_gurobi.so +0 -0
- casadi/libcasadi_conic_gurobi.so.3.7 +0 -0
- casadi/libcasadi_conic_hpipm.so +0 -0
- casadi/libcasadi_conic_hpipm.so.3.7 +0 -0
- casadi/libcasadi_conic_ipqp.so +0 -0
- casadi/libcasadi_conic_ipqp.so.3.7 +0 -0
- casadi/libcasadi_conic_nlpsol.so +0 -0
- casadi/libcasadi_conic_nlpsol.so.3.7 +0 -0
- casadi/libcasadi_conic_osqp.so +0 -0
- casadi/libcasadi_conic_osqp.so.3.7 +0 -0
- casadi/libcasadi_conic_proxqp.so +0 -0
- casadi/libcasadi_conic_proxqp.so.3.7 +0 -0
- casadi/libcasadi_conic_qpoases.so +0 -0
- casadi/libcasadi_conic_qpoases.so.3.7 +0 -0
- casadi/libcasadi_conic_qrqp.so +0 -0
- casadi/libcasadi_conic_qrqp.so.3.7 +0 -0
- casadi/libcasadi_conic_superscs.so +0 -0
- casadi/libcasadi_conic_superscs.so.3.7 +0 -0
- casadi/libcasadi_filesystem_ghc.so +0 -0
- casadi/libcasadi_filesystem_ghc.so.3.7 +0 -0
- casadi/libcasadi_importer_shell.so +0 -0
- casadi/libcasadi_importer_shell.so.3.7 +0 -0
- casadi/libcasadi_integrator_collocation.so +0 -0
- casadi/libcasadi_integrator_collocation.so.3.7 +0 -0
- casadi/libcasadi_integrator_cvodes.so +0 -0
- casadi/libcasadi_integrator_cvodes.so.3.7 +0 -0
- casadi/libcasadi_integrator_idas.so +0 -0
- casadi/libcasadi_integrator_idas.so.3.7 +0 -0
- casadi/libcasadi_integrator_rk.so +0 -0
- casadi/libcasadi_integrator_rk.so.3.7 +0 -0
- casadi/libcasadi_interpolant_bspline.so +0 -0
- casadi/libcasadi_interpolant_bspline.so.3.7 +0 -0
- casadi/libcasadi_interpolant_linear.so +0 -0
- casadi/libcasadi_interpolant_linear.so.3.7 +0 -0
- casadi/libcasadi_linsol_csparse.so +0 -0
- casadi/libcasadi_linsol_csparse.so.3.7 +0 -0
- casadi/libcasadi_linsol_csparsecholesky.so +0 -0
- casadi/libcasadi_linsol_csparsecholesky.so.3.7 +0 -0
- casadi/libcasadi_linsol_lapacklu.so +0 -0
- casadi/libcasadi_linsol_lapacklu.so.3.7 +0 -0
- casadi/libcasadi_linsol_lapackqr.so +0 -0
- casadi/libcasadi_linsol_lapackqr.so.3.7 +0 -0
- casadi/libcasadi_linsol_ldl.so +0 -0
- casadi/libcasadi_linsol_ldl.so.3.7 +0 -0
- casadi/libcasadi_linsol_lsqr.so +0 -0
- casadi/libcasadi_linsol_lsqr.so.3.7 +0 -0
- casadi/libcasadi_linsol_ma27.so +0 -0
- casadi/libcasadi_linsol_ma27.so.3.7 +0 -0
- casadi/libcasadi_linsol_mumps.so +0 -0
- casadi/libcasadi_linsol_mumps.so.3.7 +0 -0
- casadi/libcasadi_linsol_qr.so +0 -0
- casadi/libcasadi_linsol_qr.so.3.7 +0 -0
- casadi/libcasadi_linsol_symbolicqr.so +0 -0
- casadi/libcasadi_linsol_symbolicqr.so.3.7 +0 -0
- casadi/libcasadi_linsol_tridiag.so +0 -0
- casadi/libcasadi_linsol_tridiag.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_alpaqa.so +0 -0
- casadi/libcasadi_nlpsol_alpaqa.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_ampl.so +0 -0
- casadi/libcasadi_nlpsol_ampl.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_blocksqp.so +0 -0
- casadi/libcasadi_nlpsol_blocksqp.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_fatrop.so +0 -0
- casadi/libcasadi_nlpsol_fatrop.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_feasiblesqpmethod.so +0 -0
- casadi/libcasadi_nlpsol_feasiblesqpmethod.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_ipopt.so +0 -0
- casadi/libcasadi_nlpsol_ipopt.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_knitro.so +0 -0
- casadi/libcasadi_nlpsol_knitro.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_madnlp.so +0 -0
- casadi/libcasadi_nlpsol_madnlp.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_qrsqp.so +0 -0
- casadi/libcasadi_nlpsol_qrsqp.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_scpgen.so +0 -0
- casadi/libcasadi_nlpsol_scpgen.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_snopt.so +0 -0
- casadi/libcasadi_nlpsol_snopt.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_sqpmethod.so +0 -0
- casadi/libcasadi_nlpsol_sqpmethod.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_worhp.so +0 -0
- casadi/libcasadi_nlpsol_worhp.so.3.7 +0 -0
- casadi/libcasadi_rootfinder_fast_newton.so +0 -0
- casadi/libcasadi_rootfinder_fast_newton.so.3.7 +0 -0
- casadi/libcasadi_rootfinder_kinsol.so +0 -0
- casadi/libcasadi_rootfinder_kinsol.so.3.7 +0 -0
- casadi/libcasadi_rootfinder_newton.so +0 -0
- casadi/libcasadi_rootfinder_newton.so.3.7 +0 -0
- casadi/libcasadi_rootfinder_nlpsol.so +0 -0
- casadi/libcasadi_rootfinder_nlpsol.so.3.7 +0 -0
- casadi/libcasadi_sundials_common.so +0 -0
- casadi/libcasadi_sundials_common.so.3.7 +0 -0
- casadi/libcasadi_xmlfile_tinyxml.so +0 -0
- casadi/libcasadi_xmlfile_tinyxml.so.3.7 +0 -0
- casadi/libcoinmumps.so +0 -0
- casadi/libcoinmumps.so.3 +0 -0
- casadi/libcoinmumps.so.3.0.1 +0 -0
- casadi/libfatrop.so +0 -0
- casadi/libgfortran-9121747c.so.5.0.0 +0 -0
- casadi/libipopt.so +0 -0
- casadi/libipopt.so.3 +0 -0
- casadi/libipopt.so.3.14.11 +0 -0
- casadi/libsipopt.so +0 -0
- casadi/libsipopt.so.3 +0 -0
- casadi/libsipopt.so.3.14.11 +0 -0
- casadi/libz.a +0 -0
- casadi/libz.so +0 -0
- casadi/libz.so.1 +0 -0
- casadi/libz.so.1.3.1 +0 -0
- casadi/libzip.a +0 -0
- casadi/pkgconfig/casadi.pc +1 -1
- casadi/pkgconfig/libzip.pc +14 -0
- casadi/tools/__init__.py +3 -1
- casadi/tools/graph/graph.py +1 -1
- casadi/tools/structure3.py +7 -7
- {casadi-3.6.7.dist-info → casadi-3.7.1.dist-info}/METADATA +1 -1
- {casadi-3.6.7.dist-info → casadi-3.7.1.dist-info}/RECORD +215 -173
- casadi/include/tinyxml2.h +0 -2380
- casadi/lib/cmake/tinyxml2/tinyxml2-config.cmake +0 -57
- casadi/lib/cmake/tinyxml2/tinyxml2-static-targets-release.cmake +0 -19
- casadi/lib/libtinyxml2.a +0 -0
- casadi/lib/pkgconfig/tinyxml2.pc +0 -10
- casadi/tools/structure.py +0 -1446
- {casadi-3.6.7.dist-info → casadi-3.7.1.dist-info}/WHEEL +0 -0
@@ -0,0 +1,141 @@
|
|
1
|
+
# Copyright (C) 2020 Dieter Baron and Thomas Klausner
|
2
|
+
#
|
3
|
+
# The authors can be contacted at <info@libzip.org>
|
4
|
+
#
|
5
|
+
# Redistribution and use in source and binary forms, with or without
|
6
|
+
# modification, are permitted provided that the following conditions
|
7
|
+
# are met:
|
8
|
+
#
|
9
|
+
# 1. Redistributions of source code must retain the above copyright
|
10
|
+
# notice, this list of conditions and the following disclaimer.
|
11
|
+
#
|
12
|
+
# 2. Redistributions in binary form must reproduce the above copyright
|
13
|
+
# notice, this list of conditions and the following disclaimer in
|
14
|
+
# the documentation and/or other materials provided with the
|
15
|
+
# distribution.
|
16
|
+
#
|
17
|
+
# 3. The names of the authors may not be used to endorse or promote
|
18
|
+
# products derived from this software without specific prior
|
19
|
+
# written permission.
|
20
|
+
#
|
21
|
+
# THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
|
22
|
+
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
23
|
+
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
24
|
+
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
|
25
|
+
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
26
|
+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
27
|
+
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
28
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
29
|
+
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
30
|
+
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
31
|
+
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
32
|
+
|
33
|
+
#[=======================================================================[.rst:
|
34
|
+
FindNettle
|
35
|
+
-------
|
36
|
+
|
37
|
+
Finds the Nettle library.
|
38
|
+
|
39
|
+
Imported Targets
|
40
|
+
^^^^^^^^^^^^^^^^
|
41
|
+
|
42
|
+
This module provides the following imported targets, if found:
|
43
|
+
|
44
|
+
``Nettle::Nettle``
|
45
|
+
The Nettle library
|
46
|
+
|
47
|
+
Result Variables
|
48
|
+
^^^^^^^^^^^^^^^^
|
49
|
+
|
50
|
+
This will define the following variables:
|
51
|
+
|
52
|
+
``Nettle_FOUND``
|
53
|
+
True if the system has the Nettle library.
|
54
|
+
``Nettle_VERSION``
|
55
|
+
The version of the Nettle library which was found.
|
56
|
+
``Nettle_INCLUDE_DIRS``
|
57
|
+
Include directories needed to use Nettle.
|
58
|
+
``Nettle_LIBRARIES``
|
59
|
+
Libraries needed to link to Nettle.
|
60
|
+
|
61
|
+
Cache Variables
|
62
|
+
^^^^^^^^^^^^^^^
|
63
|
+
|
64
|
+
The following cache variables may also be set:
|
65
|
+
|
66
|
+
``Nettle_INCLUDE_DIR``
|
67
|
+
The directory containing ``nettle/aes.h``.
|
68
|
+
``Nettle_LIBRARY``
|
69
|
+
The path to the Nettle library.
|
70
|
+
|
71
|
+
#]=======================================================================]
|
72
|
+
|
73
|
+
find_package(PkgConfig)
|
74
|
+
pkg_check_modules(PC_Nettle QUIET nettle)
|
75
|
+
|
76
|
+
find_path(Nettle_INCLUDE_DIR
|
77
|
+
NAMES nettle/aes.h nettle/md5.h nettle/pbkdf2.h nettle/ripemd160.h nettle/sha.h
|
78
|
+
PATHS ${PC_Nettle_INCLUDE_DIRS}
|
79
|
+
)
|
80
|
+
find_library(Nettle_LIBRARY
|
81
|
+
NAMES nettle
|
82
|
+
PATHS ${PC_Nettle_LIBRARY_DIRS}
|
83
|
+
)
|
84
|
+
|
85
|
+
# Extract version information from the header file
|
86
|
+
if(Nettle_INCLUDE_DIR)
|
87
|
+
# This file only exists in nettle>=3.0
|
88
|
+
if(EXISTS ${Nettle_INCLUDE_DIR}/nettle/version.h)
|
89
|
+
file(STRINGS ${Nettle_INCLUDE_DIR}/nettle/version.h _ver_major_line
|
90
|
+
REGEX "^#define NETTLE_VERSION_MAJOR *[0-9]+"
|
91
|
+
LIMIT_COUNT 1)
|
92
|
+
string(REGEX MATCH "[0-9]+"
|
93
|
+
Nettle_MAJOR_VERSION "${_ver_major_line}")
|
94
|
+
file(STRINGS ${Nettle_INCLUDE_DIR}/nettle/version.h _ver_minor_line
|
95
|
+
REGEX "^#define NETTLE_VERSION_MINOR *[0-9]+"
|
96
|
+
LIMIT_COUNT 1)
|
97
|
+
string(REGEX MATCH "[0-9]+"
|
98
|
+
Nettle_MINOR_VERSION "${_ver_minor_line}")
|
99
|
+
set(Nettle_VERSION "${Nettle_MAJOR_VERSION}.${Nettle_MINOR_VERSION}")
|
100
|
+
unset(_ver_major_line)
|
101
|
+
unset(_ver_minor_line)
|
102
|
+
else()
|
103
|
+
if(PC_Nettle_VERSION)
|
104
|
+
set(Nettle_VERSION ${PC_Nettle_VERSION})
|
105
|
+
else()
|
106
|
+
set(Nettle_VERSION "1.0")
|
107
|
+
endif()
|
108
|
+
endif()
|
109
|
+
endif()
|
110
|
+
|
111
|
+
include(FindPackageHandleStandardArgs)
|
112
|
+
find_package_handle_standard_args(Nettle
|
113
|
+
FOUND_VAR Nettle_FOUND
|
114
|
+
REQUIRED_VARS
|
115
|
+
Nettle_LIBRARY
|
116
|
+
Nettle_INCLUDE_DIR
|
117
|
+
VERSION_VAR Nettle_VERSION
|
118
|
+
)
|
119
|
+
|
120
|
+
if(Nettle_FOUND)
|
121
|
+
set(Nettle_LIBRARIES ${Nettle_LIBRARY})
|
122
|
+
set(Nettle_INCLUDE_DIRS ${Nettle_INCLUDE_DIR})
|
123
|
+
set(Nettle_DEFINITIONS ${PC_Nettle_CFLAGS_OTHER})
|
124
|
+
endif()
|
125
|
+
|
126
|
+
if(Nettle_FOUND AND NOT TARGET Nettle::Nettle)
|
127
|
+
add_library(Nettle::Nettle UNKNOWN IMPORTED)
|
128
|
+
set_target_properties(Nettle::Nettle PROPERTIES
|
129
|
+
IMPORTED_LOCATION "${Nettle_LIBRARY}"
|
130
|
+
INTERFACE_COMPILE_OPTIONS "${PC_Nettle_CFLAGS_OTHER}"
|
131
|
+
INTERFACE_INCLUDE_DIRECTORIES "${Nettle_INCLUDE_DIR}"
|
132
|
+
)
|
133
|
+
endif()
|
134
|
+
|
135
|
+
mark_as_advanced(
|
136
|
+
Nettle_INCLUDE_DIR
|
137
|
+
Nettle_LIBRARY
|
138
|
+
)
|
139
|
+
|
140
|
+
# compatibility variables
|
141
|
+
set(Nettle_VERSION_STRING ${Nettle_VERSION})
|
@@ -0,0 +1,186 @@
|
|
1
|
+
# Copyright (C) 2020 Dieter Baron and Thomas Klausner
|
2
|
+
#
|
3
|
+
# The authors can be contacted at <info@libzip.org>
|
4
|
+
#
|
5
|
+
# Redistribution and use in source and binary forms, with or without
|
6
|
+
# modification, are permitted provided that the following conditions
|
7
|
+
# are met:
|
8
|
+
#
|
9
|
+
# 1. Redistributions of source code must retain the above copyright
|
10
|
+
# notice, this list of conditions and the following disclaimer.
|
11
|
+
#
|
12
|
+
# 2. Redistributions in binary form must reproduce the above copyright
|
13
|
+
# notice, this list of conditions and the following disclaimer in
|
14
|
+
# the documentation and/or other materials provided with the
|
15
|
+
# distribution.
|
16
|
+
#
|
17
|
+
# 3. The names of the authors may not be used to endorse or promote
|
18
|
+
# products derived from this software without specific prior
|
19
|
+
# written permission.
|
20
|
+
#
|
21
|
+
# THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
|
22
|
+
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
23
|
+
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
24
|
+
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
|
25
|
+
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
26
|
+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
27
|
+
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
28
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
29
|
+
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
30
|
+
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
31
|
+
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
32
|
+
|
33
|
+
#[=======================================================================[.rst:
|
34
|
+
Findzstd
|
35
|
+
-------
|
36
|
+
|
37
|
+
Finds the Zstandard (zstd) library.
|
38
|
+
|
39
|
+
Imported Targets
|
40
|
+
^^^^^^^^^^^^^^^^
|
41
|
+
|
42
|
+
This module provides the following imported targets, if found:
|
43
|
+
|
44
|
+
``zstd::libzstd_shared``
|
45
|
+
The shared Zstandard library
|
46
|
+
``zstd::libzstd_static``
|
47
|
+
The shared Zstandard library
|
48
|
+
|
49
|
+
Result Variables
|
50
|
+
^^^^^^^^^^^^^^^^
|
51
|
+
|
52
|
+
This will define the following variables:
|
53
|
+
|
54
|
+
``zstd_FOUND``
|
55
|
+
True if the system has the Zstandard library.
|
56
|
+
``zstd_VERSION``
|
57
|
+
The version of the Zstandard library which was found.
|
58
|
+
|
59
|
+
Cache Variables
|
60
|
+
^^^^^^^^^^^^^^^
|
61
|
+
|
62
|
+
The following cache variables may also be set:
|
63
|
+
|
64
|
+
``zstd_INCLUDE_DIR``
|
65
|
+
The directory containing ``zstd.h``.
|
66
|
+
``zstd_STATIC_LIBRARY``
|
67
|
+
The path to the Zstandard static library.
|
68
|
+
``zstd_SHARED_LIBRARY``
|
69
|
+
The path to the Zstandard shared library.
|
70
|
+
``zstd_DLL``
|
71
|
+
The path to the Zstandard DLL.
|
72
|
+
|
73
|
+
#]=======================================================================]
|
74
|
+
|
75
|
+
find_package(PkgConfig)
|
76
|
+
pkg_check_modules(PC_zstd QUIET libzstd)
|
77
|
+
|
78
|
+
find_path(zstd_INCLUDE_DIR
|
79
|
+
NAMES zstd.h
|
80
|
+
HINTS ${PC_zstd_INCLUDE_DIRS}
|
81
|
+
)
|
82
|
+
|
83
|
+
find_file(zstd_DLL
|
84
|
+
NAMES libzstd.dll zstd.dll
|
85
|
+
PATH_SUFFIXES bin
|
86
|
+
HINTS ${PC_zstd_PREFIX}
|
87
|
+
)
|
88
|
+
|
89
|
+
# On Windows, we manually define the library names to avoid mistaking the
|
90
|
+
# implib for the static library
|
91
|
+
if(zstd_DLL)
|
92
|
+
set(_zstd_win_static_name zstd-static)
|
93
|
+
set(_zstd_win_shared_name zstd)
|
94
|
+
else()
|
95
|
+
# vcpkg removes the -static suffix in static builds
|
96
|
+
set(_zstd_win_static_name zstd zstd_static)
|
97
|
+
set(_zstd_win_shared_name)
|
98
|
+
endif()
|
99
|
+
|
100
|
+
set(_previous_suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
101
|
+
set(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".dylib" ".dll.a" ".lib")
|
102
|
+
find_library(zstd_SHARED_LIBRARY
|
103
|
+
NAMES zstd ${_zstd_win_shared_name}
|
104
|
+
HINTS ${PC_zstd_LIBDIR}
|
105
|
+
)
|
106
|
+
|
107
|
+
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ".lib")
|
108
|
+
find_library(zstd_STATIC_LIBRARY
|
109
|
+
NAMES zstd ${_zstd_win_static_name}
|
110
|
+
HINTS ${PC_zstd_LIBDIR}
|
111
|
+
)
|
112
|
+
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_previous_suffixes})
|
113
|
+
|
114
|
+
# Set zstd_LIBRARY to the shared library or fall back to the static library
|
115
|
+
if(zstd_SHARED_LIBRARY)
|
116
|
+
set(_zstd_LIBRARY ${zstd_SHARED_LIBRARY})
|
117
|
+
else()
|
118
|
+
set(_zstd_LIBRARY ${zstd_STATIC_LIBRARY})
|
119
|
+
endif()
|
120
|
+
|
121
|
+
# Extract version information from the header file
|
122
|
+
if(zstd_INCLUDE_DIR)
|
123
|
+
file(STRINGS ${zstd_INCLUDE_DIR}/zstd.h _ver_major_line
|
124
|
+
REGEX "^#define ZSTD_VERSION_MAJOR *[0-9]+"
|
125
|
+
LIMIT_COUNT 1)
|
126
|
+
string(REGEX MATCH "[0-9]+"
|
127
|
+
zstd_MAJOR_VERSION "${_ver_major_line}")
|
128
|
+
file(STRINGS ${zstd_INCLUDE_DIR}/zstd.h _ver_minor_line
|
129
|
+
REGEX "^#define ZSTD_VERSION_MINOR *[0-9]+"
|
130
|
+
LIMIT_COUNT 1)
|
131
|
+
string(REGEX MATCH "[0-9]+"
|
132
|
+
zstd_MINOR_VERSION "${_ver_minor_line}")
|
133
|
+
file(STRINGS ${zstd_INCLUDE_DIR}/zstd.h _ver_release_line
|
134
|
+
REGEX "^#define ZSTD_VERSION_RELEASE *[0-9]+"
|
135
|
+
LIMIT_COUNT 1)
|
136
|
+
string(REGEX MATCH "[0-9]+"
|
137
|
+
zstd_RELEASE_VERSION "${_ver_release_line}")
|
138
|
+
set(Zstd_VERSION "${zstd_MAJOR_VERSION}.${zstd_MINOR_VERSION}.${zstd_RELEASE_VERSION}")
|
139
|
+
unset(_ver_major_line)
|
140
|
+
unset(_ver_minor_line)
|
141
|
+
unset(_ver_release_line)
|
142
|
+
endif()
|
143
|
+
|
144
|
+
include(FindPackageHandleStandardArgs)
|
145
|
+
find_package_handle_standard_args(zstd
|
146
|
+
FOUND_VAR zstd_FOUND
|
147
|
+
REQUIRED_VARS
|
148
|
+
_zstd_LIBRARY
|
149
|
+
zstd_INCLUDE_DIR
|
150
|
+
VERSION_VAR zstd_VERSION
|
151
|
+
)
|
152
|
+
|
153
|
+
if(zstd_FOUND AND zstd_SHARED_LIBRARY AND NOT TARGET zstd::libzstd_shared)
|
154
|
+
add_library(zstd::libzstd_shared SHARED IMPORTED)
|
155
|
+
if(WIN32)
|
156
|
+
set_target_properties(zstd::libzstd_shared PROPERTIES
|
157
|
+
IMPORTED_LOCATION "${zstd_DLL}"
|
158
|
+
IMPORTED_IMPLIB "${zstd_SHARED_LIBRARY}"
|
159
|
+
)
|
160
|
+
else()
|
161
|
+
set_target_properties(zstd::libzstd_shared PROPERTIES
|
162
|
+
IMPORTED_LOCATION "${zstd_SHARED_LIBRARY}"
|
163
|
+
)
|
164
|
+
endif()
|
165
|
+
|
166
|
+
set_target_properties(zstd::libzstd_shared PROPERTIES
|
167
|
+
INTERFACE_COMPILE_OPTIONS "${PC_zstd_CFLAGS_OTHER}"
|
168
|
+
INTERFACE_INCLUDE_DIRECTORIES "${zstd_INCLUDE_DIR}"
|
169
|
+
)
|
170
|
+
endif()
|
171
|
+
|
172
|
+
if(zstd_FOUND AND zstd_STATIC_LIBRARY AND NOT TARGET zstd::libzstd_static)
|
173
|
+
add_library(zstd::libzstd_static STATIC IMPORTED)
|
174
|
+
set_target_properties(zstd::libzstd_static PROPERTIES
|
175
|
+
IMPORTED_LOCATION "${zstd_STATIC_LIBRARY}"
|
176
|
+
INTERFACE_COMPILE_OPTIONS "${PC_zstd_CFLAGS_OTHER}"
|
177
|
+
INTERFACE_INCLUDE_DIRECTORIES "${zstd_INCLUDE_DIR}"
|
178
|
+
)
|
179
|
+
endif()
|
180
|
+
|
181
|
+
mark_as_advanced(
|
182
|
+
zstd_INCLUDE_DIR
|
183
|
+
zstd_DLL
|
184
|
+
zstd_SHARED_LIBRARY
|
185
|
+
zstd_STATIC_LIBRARY
|
186
|
+
)
|