Skip to content

Commit 280e1c7

Browse files
zachlewislgritzantond-wetabfrabonissh4net
authored
feat(build): Python wheels workflow and build backend (#4428)
### Summary This PR is the spiritual successor to #4011. It implements a `scikit-build-core`-based python build-backend, making it possible to use `pip install .` to build from source; and it adds a Github workflow for building with `cibuildwheel` and publishing to pypi.org binary distributions (bdists) of the Python module / extensions / CLI tools for cpython 3.8-3.13, across major operating systems and architectures. When you `pip install OpenImageIO`, pip attempts to retrieve an OpenImageIO bdist from pypi.org for the host's platform / architecture / Python interpreter. If it can't find something appropriate, pip will attempt to build locally from the OpenImageIO source distribution (sdist), downloading and temporarily installing cmake and ninja if necessary. ### PEP-Compliant Packaging: `pyproject.toml` The `pyproject.toml` file is organized in three parts: 1. **Package metadata**: standard attributes identifying and describing the Python package, its run-time and build-time requirements, entry-points to executable scripts, and so forth. 2. **scikit-build-core options**: governs how `pip install ...` interacts with `cmake`. 3. **cibuildwheel options**: additional steps and considerations for building, packaging, and testing relocatable wheel build artifacts in isolated environments. ### Additions to `__ init __.py` Previously, we were using a custom OpenImageIO/__ init__.py file to help Python-3.8+ on Windows load the shared libraries linked by the Python module (i.e., the .dll files that live alongside oiiotool.exe under $PATH). This PR adds an additional method for loading the DLL path, necessitated by differences between pip-based and traditional CMake-based installs. It also adds a mechanism for invoking binary executables found in the .../site-packages/OpenImageIO/bin directory. This provides a means for exposing Python script "shims" for each CLI tool, installed to platform-specific locations under $PATH, while keeping the actual binaries in a static location relative to the dynamic libraries. Upshot is, in `pyproject.toml`, each item under `[project.scripts]` is turned into a Python script upon installation that behaves indistinguishably to the end user to the CLI binary executable of the same name. ### Relocatable Binary Distributions with `cibuildwheel` + `repairwheel` [cibuildwheel](https://github.com/pypa/cibuildwheel) is a widely-used tool for drastically streamlining the process of building, repairing, and testing Python wheels across platforms, architectures, interpreters, and interpreter versions. Additionally, the cibuildwheel-based builds set CMAKE_BUILD_TYPE to "MinSizeRel" to optimize for size (instead of speed) -- this seems to shave ~1.5MB off each .whl's size, compared to "Release" ### "Wheels" Github workflow I straight-up copied `.github/workflows/wheel.yml` from OpenColorIO and made a few OIIO-specific modifications. When pushing a commit tagged v3*, the workflow will invoke a platform-agnostic "build sdist" (source distribution) task, followed by a series of tasks for building OIIO wheels for cpython-3.8-3.13 on Windows, Linux (x86_64 + aarch64, new libstdc++), and MacOS (x86_64 + arm64) and persisting build artifacts; followed finally by a task for publishing the build artifacts to pypi.org Note: For the sake of simplicity and troubleshooting, I've made as few changes to OpenColorIO's wheel.yml as I could get away with; but in the future, we can also build wheels for the PyPy interpreter, and possibly pyodide. Note: A "trusted publisher" must be set up on pypi.org. See https://docs.pypi.org/trusted-publishers/creating-a-project-through-oidc/ ### Other Changes I made some minor adjustments to `pythonutils.cmake` and `fancy_add_executable.cmake` that only affect scikit-build-core-based installs: - -- namely, on Linux and macOS, I'm setting the INSTALL_RPATH property to point to the relative path to the dynamic libraries, for the Python module and CLI tools, respectively. This helps ensure that pip-based builds and installs from source (as opposed to installs from repaired, pre-built wheels) yield relocatable, importable packages, without needing to mess with $LD_LIBRARY_PATH etc. ## Tests `cibuildwheel` tests if `oiiotool --buildinfo` runs. If that command elicits code zero, it means the "oiiotool" Python script installed by the wheel is able to `import OpenImageIO`; that the actual binary executable `oiiotool` is properly packaged and exists in the expected location (e.g., at `.../site-packages/OpenImageIO/bin`); and that all runtime dependencies are found. ## Inspiration, Credit, Prior Art - @aclark4life's and @JeanChristopheMorinPerso's efforts + direction + discussion + advice. See [#3249](#3249), and [#4011](#4011), as well as JCM's [python_wheels](https://github.com/JeanChristopheMorinPerso/oiio/tree/python_wheels) and [python_wheels_windows](https://github.com/JeanChristopheMorinPerso/oiio/tree/python_wheels_windows) branches. This PR is an attempt to leverage OIIO-2.6+ self-building-dependency features with # 4011's minimalist and modern approach to packaging. - OpenColorIO -- I tried to copy as much as I could from @remia et al's fantastic work with all things wheels-related. The __init __.py modifications, the way we're wrapping the CLI tools, and the github Wheels workflow are lifted almost-verbatim from OCIO. Insert pun about reinventing the wheel here. - @joaovbs96's help and patience with testing stuff on Windows. --------- Signed-off-by: Zach Lewis <[email protected]> Signed-off-by: Larry Gritz <[email protected]> Signed-off-by: Anton Dukhovnikov <[email protected]> Signed-off-by: Basile Fraboni <[email protected]> Signed-off-by: Vlad (Kuzmin) Erium <[email protected]> Signed-off-by: Joseph Goldstone <[email protected]> Signed-off-by: Darby Johnston <[email protected]> Signed-off-by: Jeremy Retailleau <[email protected]> Signed-off-by: zachlewis <[email protected]> Co-authored-by: Larry Gritz <[email protected]> Co-authored-by: Anton Dukhovnikov <[email protected]> Co-authored-by: Basile Fraboni <[email protected]> Co-authored-by: Vlad (Kuzmin) Erium <[email protected]> Co-authored-by: Joseph Goldstone <[email protected]> Co-authored-by: Darby Johnston <[email protected]> Co-authored-by: Jeremy Retailleau <[email protected]> Co-authored-by: Jean-Christophe Morin <[email protected]>
1 parent 4bf3012 commit 280e1c7

19 files changed

+822
-44
lines changed

.github/workflows/wheel.yml

+407
Large diffs are not rendered by default.

.gitignore

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@ branches/
44
build/
55
dist/
66
ext/
7+
wheelhouse/
8+
_coverage/
9+
.python-version
710
.idea
811
.vscode
912
.cproject
1013
.project
1114
.DS_Store
1215
*.pyc
13-
_coverage/
16+
/*.lock
17+
gastest.o
1418

1519
# Exclude test files I tend to leave around at the top level. The leading
1620
# slash ensures that files with these extensions within subdirectories are not
@@ -21,3 +25,5 @@ _coverage/
2125
/*.jxl
2226
/*.tx
2327
/*.log
28+
29+

CMakeLists.txt

+51-2
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,38 @@ include (compiler)
181181
# Dependency finding utilities and all dependency-related options
182182
include (dependency_utils)
183183

184+
option (IGNORE_HOMEBREWED_DEPS "If ON, will ignore homebrew-installed dependencies" OFF)
185+
if (IGNORE_HOMEBREWED_DEPS)
186+
# Define the list of prefixes to ignore
187+
set (HOMEBREW_PREFIXES
188+
/opt/homebrew
189+
/usr/local
190+
/usr/X11
191+
/usr/X11R6
192+
/opt/X11
193+
)
194+
message (STATUS "Ignoring Homebrew dependencies and adjusted environment and CMake variables accordingly.")
195+
foreach (_cmake_var
196+
CMAKE_SYSTEM_INCLUDE_PATH
197+
CMAKE_SYSTEM_LIBRARY_PATH
198+
CMAKE_PREFIX_PATH)
199+
remove_prefixes_from_variable (CMAKE ${_cmake_var} "${HOMEBREW_PREFIXES}")
200+
endforeach ()
201+
202+
# Adjust CMAKE_IGNORE_PATH
203+
foreach (_prefix IN LISTS HOMEBREW_PREFIXES)
204+
list (APPEND CMAKE_IGNORE_PATH
205+
"${_prefix}"
206+
"${_prefix}/lib"
207+
"${_prefix}/bin"
208+
"${_prefix}/include"
209+
)
210+
endforeach ()
211+
212+
message (STATUS "CMAKE_IGNORE_PATH: ${CMAKE_IGNORE_PATH}")
213+
endif ()
214+
215+
184216
# Utilities and options related to finding python and making python bindings
185217
include (pythonutils)
186218

@@ -238,6 +270,17 @@ if (NOT BUILD_OIIOUTIL_ONLY)
238270
add_subdirectory (src/libOpenImageIO)
239271
endif ()
240272

273+
# Disable building of certain tools when building Python wheels
274+
if (SKBUILD)
275+
set (ENABLE_iconvert OFF)
276+
set (ENABLE_idiff OFF)
277+
set (ENABLE_igrep OFF)
278+
set (ENABLE_iinfo OFF)
279+
set (ENABLE_testtex OFF)
280+
set (ENABLE_iv OFF)
281+
endif ()
282+
283+
241284
if (OIIO_BUILD_TOOLS AND NOT BUILD_OIIOUTIL_ONLY)
242285
add_subdirectory (src/iconvert)
243286
add_subdirectory (src/idiff)
@@ -258,10 +301,16 @@ if (NOT EMBEDPLUGINS AND NOT BUILD_OIIOUTIL_ONLY)
258301
endforeach ()
259302
endif ()
260303

261-
if (USE_PYTHON AND Python3_Development_FOUND AND NOT BUILD_OIIOUTIL_ONLY)
304+
305+
if (WIN32)
306+
set (_py_dev_found Python3_Development_FOUND)
307+
else ()
308+
set (_py_dev_found Python3_Development.Module_FOUND)
309+
endif ()
310+
if (USE_PYTHON AND ${_py_dev_found} AND NOT BUILD_OIIOUTIL_ONLY)
262311
add_subdirectory (src/python)
263312
else ()
264-
message (STATUS "Not building Python bindings: USE_PYTHON=${USE_PYTHON}, Python3_Development_FOUND=${Python3_Development_FOUND}")
313+
message (STATUS "Not building Python bindings: USE_PYTHON=${USE_PYTHON}, Python3_Development.Module_FOUND=${Python3_Development.Module_FOUND}")
265314
endif ()
266315

267316
add_subdirectory (src/include)

INSTALL.md

+37-13
Original file line numberDiff line numberDiff line change
@@ -230,19 +230,20 @@ Make targets you should know about:
230230

231231
Additionally, a few helpful modifiers alter some build-time options:
232232

233-
| Target | Command |
234-
| ------------------------- | ---------------------------------------------- |
235-
| make VERBOSE=1 ... | Show all compilation commands |
236-
| make STOP_ON_WARNING=0 | Do not stop building if compiler warns |
237-
| make EMBEDPLUGINS=0 ... | Don't compile the plugins into libOpenImageIO |
238-
| make USE_OPENGL=0 ... | Skip anything that needs OpenGL |
239-
| make USE_QT=0 ... | Skip anything that needs Qt |
240-
| make MYCC=xx MYCXX=yy ... | Use custom compilers |
241-
| make USE_PYTHON=0 ... | Don't build the Python binding |
242-
| make BUILD_SHARED_LIBS=0 | Build static library instead of shared |
243-
| make LINKSTATIC=1 ... | Link with static external libraries when possible |
244-
| make SOVERSION=nn ... | Include the specified major version number in the shared object metadata |
245-
| make NAMESPACE=name | Wrap everything in another namespace |
233+
| Target | Command |
234+
| ----------------------------- | ------------------------------------------------------------------------- |
235+
| make VERBOSE=1 ... | Show all compilation commands |
236+
| make STOP_ON_WARNING=0 | Do not stop building if compiler warns |
237+
| make EMBEDPLUGINS=0 ... | Don't compile the plugins into libOpenImageIO |
238+
| make USE_OPENGL=0 ... | Skip anything that needs OpenGL |
239+
| make USE_QT=0 ... | Skip anything that needs Qt |
240+
| make MYCC=xx MYCXX=yy ... | Use custom compilers |
241+
| make USE_PYTHON=0 ... | Don't build the Python binding |
242+
| make BUILD_SHARED_LIBS=0 | Build static library instead of shared |
243+
| make IGNORE_HOMEBREWED_DEPS=1 | Ignore homebrew-managed dependencies |
244+
| make LINKSTATIC=1 ... | Link with static external libraries when possible |
245+
| make SOVERSION=nn ... | Include the specified major version number in the shared object metadata |
246+
| make NAMESPACE=name | Wrap everything in another namespace |
246247

247248
The command 'make help' will list all possible options.
248249

@@ -366,6 +367,29 @@ If you've built OIIO from source and ``import OpenImageIO`` is throwing a Module
366367
``OPENIMAGEIO_PYTHON_LOAD_DLLS_FROM_PATH=1``.
367368

368369

370+
371+
Python-based Builds and Installs
372+
--------------------------------
373+
374+
**Installing from prebuilt binary distributions**
375+
376+
If you're only interested in the Python module and the CLI tools, you can install with `pip` or `uv`:
377+
378+
> ```pip install OpenImageIO```
379+
380+
**Building and installing from source**
381+
382+
If you have a C++ compiler installed, you can also use the Python build-backend to compile and install
383+
from source by navigating to the root of the repository and running: ```pip install .```
384+
385+
This will download and install CMake and Ninja if necessary, and invoke the CMake build system; which,
386+
in turn, will build missing dependencies, compile OIIO, and install the Python module, the libraries,
387+
the headers, and the CLI tools to a platform-specific, Python-specific location.
388+
389+
See the [scikit-build-core docs](https://scikit-build-core.readthedocs.io/en/latest/configuration.html#configuring-cmake-arguments-and-defines)
390+
for more information on customizing and overriding build-tool options and CMake arguments.
391+
392+
369393
Test Images
370394
-----------
371395

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ help:
378378
@echo " USE_NUKE=0 Don't build Nuke plugins"
379379
@echo " Nuke_ROOT=path Custom Nuke installation"
380380
@echo " NUKE_VERSION=ver Custom Nuke version"
381+
@echo " IGNORE_HOMEBREWED_DEPS=1 Don't use dependencies installed by Homebrew"
381382
@echo " OIIO build-time options:"
382383
@echo " INSTALL_PREFIX=path Set installation prefix (default: ./${INSTALL_PREFIX})"
383384
@echo " NAMESPACE=name Override namespace base name (default: OpenImageIO)"

pyproject.toml

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
[project]
2+
name = "OpenImageIO"
3+
# The build backend ascertains the version from the CMakeLists.txt file.
4+
dynamic = ["version"]
5+
description = "Reading, writing, and processing images in a wide variety of file formats, using a format-agnostic API, aimed at VFX applications."
6+
authors = [
7+
{name = "Larry Gritz", email = "[email protected]"},
8+
{name = "OpenImageIO Contributors", email = "[email protected]"}
9+
]
10+
maintainers = [
11+
{name = "OpenImageIO Contributors", email="[email protected]"},
12+
]
13+
readme = "README.md"
14+
license = {text = "Apache-2.0"}
15+
classifiers = [
16+
"Natural Language :: English",
17+
"Operating System :: OS Independent",
18+
"Programming Language :: Python :: 3",
19+
"Programming Language :: Python :: 3.8",
20+
"Programming Language :: Python :: 3.9",
21+
"Programming Language :: Python :: 3.10",
22+
"Programming Language :: Python :: 3.11",
23+
"Programming Language :: Python :: 3.12",
24+
"Programming Language :: Python :: 3.13",
25+
"License :: OSI Approved :: Apache Software License",
26+
"Topic :: Multimedia :: Graphics",
27+
"Topic :: Multimedia :: Video",
28+
"Topic :: Multimedia :: Video :: Display",
29+
"Topic :: Software Development :: Libraries :: Python Modules",
30+
]
31+
requires-python = ">= 3.8"
32+
33+
[project.urls]
34+
Homepage = "https://openimageio.org/"
35+
Source = "https://github.com/AcademySoftwareFoundation/OpenImageIO"
36+
Documentation = "https://docs.openimageio.org"
37+
Issues = "https://github.com/AcademySoftwareFoundation/OpenImageIO/issues"
38+
39+
40+
[project.scripts]
41+
# Use the convention below to expose CLI tools as Python scripts.
42+
maketx = "OpenImageIO:_command_line"
43+
oiiotool = "OpenImageIO:_command_line"
44+
45+
[build-system]
46+
build-backend = "scikit_build_core.build"
47+
requires = [
48+
"scikit-build-core>=0.10.6,<1",
49+
"pybind11",
50+
]
51+
52+
[tool.scikit-build]
53+
build.verbose = true
54+
# Exclude unnecessary directories from the source distribution.
55+
sdist.exclude = [".github", "testsuite", "ASWF", "docs"]
56+
# Pin minimum scikit-build-core to that specified in build-system.requires.
57+
minimum-version = "build-system.requires"
58+
# Pin minimum CMake version to that specified in CMakeLists.txt.
59+
cmake.version = "CMakeLists.txt"
60+
wheel.license-files = ["LICENSE.md", "THIRD-PARTY.md"]
61+
# Make sure the package is structured as expected.
62+
wheel.install-dir = "OpenImageIO"
63+
# Only install the user and fonts components.
64+
install.components = ["user", "fonts"]
65+
66+
[tool.scikit-build.cmake.define]
67+
# Build missing dependencies. See src/cmake for details.
68+
OpenImageIO_BUILD_MISSING_DEPS = "all"
69+
# Don't build tests. Dramatically improves build time.
70+
OIIO_BUILD_TESTS = "0"
71+
# Prefer linking static dependencies when possible.
72+
LINKSTATIC = "1"
73+
# Standardize the install directory for libraries, as expected by
74+
# other parts of the wheels build process.
75+
CMAKE_INSTALL_LIBDIR = "lib"
76+
77+
# Dynamically set the package version metadata by pasrsing CMakeLists.txt.
78+
[tool.scikit-build.metadata.version]
79+
provider = "scikit_build_core.metadata.regex"
80+
input = "CMakeLists.txt"
81+
regex = 'set \(OpenImageIO_VERSION "(?P<value>[0-9a-z.]+)"\)'
82+
83+
# On macOS, ensure dependencies are only built for the target architecture.
84+
[[tool.scikit-build.overrides]]
85+
if.platform-system = "darwin"
86+
if.platform-machine = "arm64"
87+
inherit.cmake.define = "append"
88+
cmake.define.CMAKE_OSX_ARCHITECTURES = "arm64"
89+
90+
[[tool.scikit-build.overrides]]
91+
if.platform-system = "darwin"
92+
if.platform-machine = "x86_64"
93+
inherit.cmake.define = "append"
94+
cmake.define.CMAKE_OSX_ARCHITECTURES = "x86_64"
95+
96+
[tool.cibuildwheel]
97+
build-verbosity = 1
98+
skip = [
99+
# Skip 32-bit builds
100+
"*-win32",
101+
"*-manylinux_i686",
102+
# Building with musl seems to work, but the repair-wheel step seems to fail...
103+
# This may be a bug in repairwheel (or auditwheel)?
104+
"*musllinux*",
105+
]
106+
test-command = "oiiotool --buildinfo"
107+
108+
[tool.cibuildwheel.macos.environment]
109+
SKBUILD_CMAKE_ARGS = "-DLINKSTATIC=1; -DIGNORE_HOMEBREWED_DEPS=1"
110+
# C++17 - std::filesystem is only available in macOS 10.15 and later; ARM compatibility introduced in 11.
111+
MACOSX_DEPLOYMENT_TARGET = "11"
112+
# Optimize for size (not speed).
113+
SKBUILD_CMAKE_BUILD_TYPE = "MinSizeRel"
114+
115+
[tool.cibuildwheel.linux.environment]
116+
SKBUILD_CMAKE_ARGS = "-DLINKSTATIC=1"
117+
# Suppress warnings that cause linux cibuildwheel build to fail
118+
CXXFLAGS = "-Wno-error=stringop-overflow -Wno-pragmas"
119+
SKBUILD_CMAKE_BUILD_TYPE = "MinSizeRel"
120+
121+
[tool.cibuildwheel.windows.environment]
122+
SKBUILD_CMAKE_BUILD_TYPE = "MinSizeRel"

src/cmake/build_Freetype.cmake

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ set_cache (Freetype_BUILD_SHARED_LIBS OFF
1717

1818
string (MAKE_C_IDENTIFIER ${Freetype_BUILD_VERSION} Freetype_VERSION_IDENT)
1919

20-
# Conditionally disable support for PNG-compressed OpenType embedded bitmaps on Apple Silicon
21-
# https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4423#issuecomment-2455034286
22-
if ( APPLE AND ( CMAKE_SYSTEM_PROCESSOR MATCHES "arm64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" ) )
20+
# Conditionally disable support for PNG-compressed OpenType embedded bitmaps on MacOS
21+
# https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4423#issuecomment-2455217897
22+
if ( APPLE )
2323
set (_freetype_EXTRA_CMAKE_ARGS -DFT_DISABLE_PNG=ON )
2424
endif ()
2525

src/cmake/build_OpenColorIO.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# OpenColorIO by hand!
77
######################################################################
88

9-
set_cache (OpenColorIO_BUILD_VERSION 2.4.0 "OpenColorIO version for local builds")
9+
set_cache (OpenColorIO_BUILD_VERSION 2.4.1 "OpenColorIO version for local builds")
1010
set (OpenColorIO_GIT_REPOSITORY "https://github.com/AcademySoftwareFoundation/OpenColorIO")
1111
set (OpenColorIO_GIT_TAG "v${OpenColorIO_BUILD_VERSION}")
1212
set_cache (OpenColorIO_BUILD_SHARED_LIBS OFF #ON

src/cmake/build_PNG.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ set_cache (PNG_BUILD_VERSION 1.6.44 "PNG version for local builds")
1010
set (PNG_GIT_REPOSITORY "https://github.com/glennrp/libpng")
1111
set (PNG_GIT_TAG "v${PNG_BUILD_VERSION}")
1212

13-
set_cache (PNG_BUILD_SHARED_LIBS ${LOCAL_BUILD_SHARED_LIBS_DEFAULT}
13+
set_cache (PNG_BUILD_SHARED_LIBS OFF
1414
DOC "Should execute a local PNG build, if necessary, build shared libraries" ADVANCED)
1515

1616
string (MAKE_C_IDENTIFIER ${PNG_BUILD_VERSION} PNG_VERSION_IDENT)
@@ -28,7 +28,7 @@ build_dependency_with_cmake (PNG
2828
GIT_REPOSITORY ${PNG_GIT_REPOSITORY}
2929
GIT_TAG ${PNG_GIT_TAG}
3030
CMAKE_ARGS
31-
-D PNG_SHARED=OFF
31+
-D PNG_SHARED=${PNG_BUILD_SHARED_LIBS}
3232
-D PNG_STATIC=ON
3333
-D PNG_EXECUTABLES=OFF
3434
-D PNG_TESTS=OFF

src/cmake/build_libdeflate.cmake

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
set_cache (libdeflate_BUILD_VERSION 1.20 "libdeflate version for local builds")
1010
set (libdeflate_GIT_REPOSITORY "https://github.com/ebiggers/libdeflate")
1111
set (libdeflate_GIT_TAG "v${libdeflate_BUILD_VERSION}")
12-
set_cache (libdeflate_BUILD_SHARED_LIBS ${LOCAL_BUILD_SHARED_LIBS_DEFAULT}
12+
set_cache (libdeflate_BUILD_SHARED_LIBS OFF # ${LOCAL_BUILD_SHARED_LIBS_DEFAULT}
1313
DOC "Should a local libdeflate build, if necessary, build shared libraries" ADVANCED)
1414

1515
string (MAKE_C_IDENTIFIER ${libdeflate_BUILD_VERSION} libdeflate_VERSION_IDENT)
@@ -20,6 +20,7 @@ build_dependency_with_cmake(libdeflate
2020
GIT_TAG ${libdeflate_GIT_TAG}
2121
CMAKE_ARGS
2222
-D BUILD_SHARED_LIBS=${libdeflate_BUILD_SHARED_LIBS}
23+
-D LIBDEFLATE_BUILD_SHARED_LIB=${libdeflate_BUILD_SHARED_LIBS}
2324
-D CMAKE_POSITION_INDEPENDENT_CODE=ON
2425
-D CMAKE_INSTALL_LIBDIR=lib
2526
-D LIBDEFLATE_BUILD_GZIP=OFF
@@ -32,6 +33,7 @@ set (libdeflate_ROOT ${libdeflate_LOCAL_INSTALL_DIR})
3233
# Signal to caller that we need to find again at the installed location
3334
set (libdeflate_REFIND TRUE)
3435
set (libdeflate_REFIND_ARGS CONFIG)
36+
set (libdeflate_REFIND_VERSION ${libdeflate_BUILD_VERSION})
3537

3638
if (libdeflate_BUILD_SHARED_LIBS)
3739
install_local_dependency_libs (libdeflate libdeflate)

0 commit comments

Comments
 (0)