Skip to content

Commit e4a7c47

Browse files
committed
build(deps): Raise minimum CMake dependency from 3.12 to 3.15
This bump brings access to the following interesting features (not a comprehensive list): - 3.13 Nov 21, 2018 - -B, -S let you specify source and build directories without the "cd" dance - target_link_options() - ctest --progress / CTEST_PROGRESS_OUTPUT - 3.14 Mar 14, 2019 - cmake --build now supports -v/--verbose - file(CREATE_LINK ) - FindGIF now has imported targets - 3.15 Jul 17, 2019 - env CMAKE_GENERATOR can be used instead of -G - when using --build, the --target can now list multiple targets (and also can be `-t`) - --install can be used separately without running through the whole build - message() now supports NOTICE, VERBOSE, DEBUG and TRACE. - CMAKE_FIND_PACKAGE_PREFER_CONFIG variable - Enable C++20 for Apple Clang Make sure all CI cases have a new enough cmake Use GIF targets, now enabled with CMake 3.14 Use message(VERBOSE ...) feature to simplify lots of `if` blocks. Clean up code for older cmake versions Note that this will NOT be backported to the current release branch, but it will be part of the upcoming 2.5 family of reseases. Signed-off-by: Larry Gritz <[email protected]>
1 parent e203bd6 commit e4a7c47

24 files changed

+105
-170
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
simd: sse4.2
4141
fmt_ver: 6.1.2
4242
pybind11_ver: v2.4.2
43-
setenvs: export PUGIXML_VERSION=v1.9
43+
setenvs: export PUGIXML_VERSION=v1.9 CMAKE_VERSION=3.15.5
4444
- desc: gcc6/C++14 py3.7 boost1.70 exr2.4 ocio1.1
4545
nametag: linux-vfx2020
4646
os: ubuntu-latest
@@ -162,11 +162,12 @@ jobs:
162162
python_ver: 2.7
163163
simd: 0
164164
setenvs: export EMBEDPLUGINS=0
165+
CMAKE_VERSION=3.15.5
165166
PTEX_VERSION=v2.3.1
167+
WEBP_VERSION=v1.0.0
166168
USE_JPEGTURBO=0
167169
USE_OPENCOLORIO=0
168170
USE_OPENCV=0
169-
WEBP_VERSION=v1.0.0
170171
depcmds: sudo rm -rf /usr/local/include/OpenEXR
171172

172173
# Test formatting. This test entry doesn't do a full build, it

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: BSD-3-Clause and Apache-2.0
33
# https://github.com/OpenImageIO/oiio
44

5-
cmake_minimum_required (VERSION 3.12)
5+
cmake_minimum_required (VERSION 3.15)
66

77
set (OpenImageIO_VERSION "2.5.2.0")
88
set (OpenImageIO_VERSION_OVERRIDE "" CACHE STRING

INSTALL.md

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ NEW or CHANGED MINIMUM dependencies since the last major release are **bold**.
1919
CMake configuration flag: `-DCMAKE_CXX_STANDARD=17`, etc.
2020
* Compilers: gcc 6.1 - 12.1, clang 3.4 - 16, MSVS 2017 - 2019,
2121
Intel icc 17+, Intel OneAPI C++ compiler 2022+.
22-
* CMake >= 3.12 (tested through 3.26)
22+
* CMake >= 3.15 (tested through 3.27)
2323
* OpenEXR/Imath >= 2.3 (recommended: 2.4 or higher; tested through 3.1 and main)
2424
* libTIFF >= 3.9 (recommended: 4.0+; tested through 4.5)
2525
* libjpeg >= 8, or libjpeg-turbo >= 1.1 (tested through jpeg9d and jpeg-turbo
@@ -251,9 +251,8 @@ The command 'make help' will list all possible options.
251251
You can also ignore the top level Makefile wrapper, and instead use
252252
CMake directly:
253253

254-
mkdir build
255-
cd build
256-
cmake ..
254+
cmake -B build -S .
255+
cmake --build build --target install
257256

258257
If the compile stops because of warnings, try again with
259258

@@ -262,8 +261,9 @@ If the compile stops because of warnings, try again with
262261

263262
or, if you are using CMake directly,
264263

265-
cd build
266-
cmake -DSTOP_ON_WARNING=0 ..
264+
rm -rf build
265+
cmake -B build -S . -DSTOP_ON_WARNING=0
266+
cmake --build build --target install
267267

268268

269269

@@ -288,56 +288,51 @@ the section below, and will only have to point OIIO build process so their locat
288288
```
289289
cd {ZLIB_ROOT}
290290
git clone https://github.com/madler/zlib .
291-
mkdir build
292-
cd build
293-
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=. ..
294-
cmake --build . --config Release --target install
295-
del lib\zlib.lib
291+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=.
292+
cmake --build build --config Release --target install
293+
del build\lib\zlib.lib
296294
```
297295
* libTIFF:
298296
```
299297
cd {TIFF_ROOT}
300298
git clone https://gitlab.com/libtiff/libtiff.git .
301-
cd build
302-
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=. ..
303-
cmake --build . --target install
299+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=.
300+
cmake --build build --target install
304301
```
305302
* libjpeg-turbo:
306303
```
307304
cd {JPEG_ROOT}
308305
git clone https://github.com/libjpeg-turbo/libjpeg-turbo .
309306
mkdir build
310307
cd build
311-
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_SHARED=OFF -DCMAKE_INSTALL_PREFIX=. ..
312-
cmake --build . --config Release --target install
308+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DENABLE_SHARED=OFF -DCMAKE_INSTALL_PREFIX=.
309+
cmake --build build --config Release --target install
313310
```
314311
* OpenEXR: you'll have to point it to your `{ZLIB_ROOT}` location from the above. If copy-pasting the multi-line command (with lines ending in `^`) into
315312
cmd.exe prompt, make sure to copy all the lines at once.
316313
```
317314
cd {EXR_ROOT}
318315
git clone https://github.com/AcademySoftwareFoundation/openexr .
319-
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=dist ^
316+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=dist ^
320317
-DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DOPENEXR_BUILD_TOOLS=OFF ^
321318
-DOPENEXR_INSTALL_TOOLS=OFF -DOPENEXR_INSTALL_EXAMPLES=OFF ^
322-
-DZLIB_ROOT={ZLIB_ROOT}\build ..
323-
cmake --build . --target install --config Release
319+
-DZLIB_ROOT={ZLIB_ROOT}\build
320+
cmake --build build --target install --config Release
324321
```
325322

326323
Now get the OIIO source and do one-time CMake configuration step. Replace `{*_ROOT}` below with folders where you have put the 3rd party
327324
dependencies.
328325
```
329326
cd {OIIO_ROOT}
330327
git clone https://github.com/OpenImageIO/oiio .
331-
mkdir build
332-
cd build
333-
cmake -DVERBOSE=ON -DCMAKE_BUILD_TYPE=Release ^
328+
cmake -S . -B build -DVERBOSE=ON -DCMAKE_BUILD_TYPE=Release ^
334329
-DBoost_USE_STATIC_LIBS=ON -DBoost_NO_WARN_NEW_VERSIONS=ON -DBoost_ROOT={BOOST_ROOT} ^
335330
-DZLIB_ROOT={ZLIB_ROOT}\build ^
336331
-DTIFF_ROOT={TIFF_ROOT}\build ^
337332
-DOpenEXR_ROOT={EXR_ROOT}\build\dist ^
338333
-DImath_DIR={EXR_ROOT}\build\dist\lib\cmake\Imath ^
339334
-DJPEG_ROOT={JPEG_ROOT}\build ^
340-
-DUSE_PYTHON=0 -DUSE_QT=0 -DBUILD_SHARED_LIBS=0 -DLINKSTATIC=1 ..
335+
-DUSE_PYTHON=0 -DUSE_QT=0 -DBUILD_SHARED_LIBS=0 -DLINKSTATIC=1
341336
```
342337

343338
This will produce `{OIIO_ROOT}/build/OpenImageIO.sln` that can be opened in Visual Studio IDE. Note that the solution will be

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ clang-format: config
299299
# DEPRECATED: 'make dist' is just a synonym for 'make install'
300300
dist : install
301301

302-
TEST_FLAGS += --force-new-ctest-process --output-on-failure
302+
TEST_FLAGS += --force-new-ctest-process --output-on-failure --progress
303303

304304
# 'make test' does a full build and then runs all tests
305305
test: build

src/build-scripts/build_OpenJPEG.bash

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,13 @@ cd ${OPENJPEG_SRC_DIR}
3636
echo "git checkout ${OPENJPEG_VERSION} --force"
3737
git checkout ${OPENJPEG_VERSION} --force
3838

39-
mkdir -p ${OPENJPEG_BUILD_DIR} && true
40-
cd ${OPENJPEG_BUILD_DIR}
41-
4239
if [[ -z $DEP_DOWNLOAD_ONLY ]]; then
43-
time cmake -DCMAKE_BUILD_TYPE=Release \
40+
time cmake -S . -B ${OPENJPEG_BUILD_DIR} \
41+
-DCMAKE_BUILD_TYPE=Release \
4442
-DCMAKE_INSTALL_PREFIX=${OPENJPEG_INSTALL_DIR} \
4543
-DBUILD_CODEC=OFF \
46-
${OPENJPEG_CONFIG_OPTS} ..
47-
time cmake --build . --config Release --target install
44+
${OPENJPEG_CONFIG_OPTS}
45+
time cmake --build ${OPENJPEG_BUILD_DIR} --config Release --target install
4846
fi
4947

5048
# ls -R ${OPENJPEG_INSTALL_DIR}

src/build-scripts/build_Ptex.bash

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,10 @@ cd ${PTEX_SRC_DIR}
3131
echo "git checkout ${PTEX_VERSION} --force"
3232
git checkout ${PTEX_VERSION} --force
3333

34-
mkdir -p ${PTEX_BUILD_DIR}
35-
cd ${PTEX_BUILD_DIR}
36-
time cmake -DCMAKE_BUILD_TYPE=Release \
34+
time cmake -S . -B ${PTEX_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release \
3735
-DCMAKE_INSTALL_PREFIX=${PTEX_INSTALL_DIR} \
38-
${PTEX_CONFIG_OPTS} ..
39-
time cmake --build . --config Release --target install
36+
${PTEX_CONFIG_OPTS}
37+
time cmake --build ${PTEX_BUILD_DIR} --config Release --target install
4038

4139
# ls -R ${PTEX_INSTALL_DIR}
4240
popd

src/build-scripts/build_cmake.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ set -ex
1212
echo "Building cmake"
1313
uname
1414

15-
CMAKE_VERSION=${CMAKE_VERSION:=3.12.4}
15+
CMAKE_VERSION=${CMAKE_VERSION:=3.18.5}
1616
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
1717
CMAKE_INSTALL_DIR=${CMAKE_INSTALL_DIR:=${LOCAL_DEPS_DIR}/cmake}
1818

src/build-scripts/build_libjpeg-turbo.bash

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,11 @@ cd ${LIBJPEGTURBO_SRC_DIR}
3636
echo "git checkout ${LIBJPEGTURBO_VERSION} --force"
3737
git checkout ${LIBJPEGTURBO_VERSION} --force
3838

39-
mkdir -p ${LIBJPEGTURBO_BUILD_DIR}
40-
cd ${LIBJPEGTURBO_BUILD_DIR}
41-
4239
if [[ -z $DEP_DOWNLOAD_ONLY ]]; then
43-
time cmake -DCMAKE_BUILD_TYPE=Release \
40+
time cmake -S . -B ${LIBJPEGTURBO_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release \
4441
-DCMAKE_INSTALL_PREFIX=${LIBJPEGTURBO_INSTALL_DIR} \
45-
${LIBJPEGTURBO_CONFIG_OPTS} ..
46-
time cmake --build . --config Release --target install
42+
${LIBJPEGTURBO_CONFIG_OPTS}
43+
time cmake --build ${LIBJPEGTURBO_BUILD_DIR} --config Release --target install
4744
fi
4845

4946
# ls -R ${LIBJPEGTURBO_INSTALL_DIR}

src/build-scripts/build_libpng.bash

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,13 @@ cd ${LIBPNG_SRC_DIR}
3838
echo "git checkout ${LIBPNG_VERSION} --force"
3939
git checkout ${LIBPNG_VERSION} --force
4040

41-
mkdir -p ${LIBPNG_BUILD_DIR}
42-
cd ${LIBPNG_BUILD_DIR}
43-
4441
if [[ -z $DEP_DOWNLOAD_ONLY ]]; then
45-
time cmake -DCMAKE_BUILD_TYPE=Release \
42+
time cmake -S . -B ${LIBPNG_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release \
4643
-DCMAKE_INSTALL_PREFIX=${LIBPNG_INSTALL_DIR} \
4744
-DPNG_EXECUTABLES=OFF \
4845
-DPNG_TESTS=OFF \
49-
${LIBPNG_CONFIG_OPTS} ..
50-
time cmake --build . --config Release --target install
46+
${LIBPNG_CONFIG_OPTS}
47+
time cmake --build ${LIBPNG_BUILD_DIR} --config Release --target install
5148
fi
5249

5350
# ls -R ${LIBPNG_INSTALL_DIR}

src/build-scripts/build_libtiff.bash

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,17 @@ cd libtiff
3636
echo "git checkout ${LIBTIFF_VERSION} --force"
3737
git checkout ${LIBTIFF_VERSION} --force
3838

39-
mkdir -p build
40-
cd build
41-
4239
if [[ -z $DEP_DOWNLOAD_ONLY ]]; then
43-
time cmake -DCMAKE_BUILD_TYPE=${LIBTIFF_BUILD_TYPE} \
40+
time cmake -S . -B build \
41+
-DCMAKE_BUILD_TYPE=${LIBTIFF_BUILD_TYPE} \
4442
-DCMAKE_INSTALL_PREFIX=${LIBTIFF_INSTALL_DIR} \
4543
-DCMAKE_CXX_FLAGS="${LIBTIFF_CXX_FLAGS}" \
4644
-DBUILD_SHARED_LIBS=${LIBTIFF_BUILD_SHARED_LIBS:-ON} \
4745
-Dtiff-tests=${LIBTIFF_BUILD_TESTS:-OFF} \
4846
-Dtiff-docs=${LIBTIFF_BUILD_TESTS:-OFF} \
4947
-Dlibdeflate=ON \
50-
${LIBTIFF_BUILDOPTS} ..
51-
time cmake --build . --target install
48+
${LIBTIFF_BUILDOPTS}
49+
time cmake --build build --target install
5250
fi
5351

5452
popd

src/build-scripts/build_opencolorio.bash

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
1818
OPENCOLORIO_SOURCE_DIR=${OPENCOLORIO_SOURCE_DIR:=${LOCAL_DEPS_DIR}/OpenColorIO}
1919
OPENCOLORIO_BUILD_DIR=${OPENCOLORIO_BUILD_DIR:=${LOCAL_DEPS_DIR}/OpenColorIO-build}
2020
OPENCOLORIO_INSTALL_DIR=${OPENCOLORIO_INSTALL_DIR:=${LOCAL_DEPS_DIR}/dist}
21+
OPENCOLORIO_BUILD_TYPE=${OPENCOLORIO_BUILD_TYPE:=Release}
2122
OPENCOLORIO_CXX_FLAGS=${OPENCOLORIO_CXX_FLAGS:="-Wno-unused-function -Wno-deprecated-declarations -Wno-cast-qual -Wno-write-strings"}
2223
# Just need libs:
2324
OPENCOLORIO_BUILDOPTS="-DOCIO_BUILD_APPS=OFF -DOCIO_BUILD_NUKE=OFF \
@@ -42,13 +43,12 @@ cd ${OPENCOLORIO_SOURCE_DIR}
4243

4344
echo "git checkout ${OPENCOLORIO_VERSION} --force"
4445
git checkout ${OPENCOLORIO_VERSION} --force
45-
mkdir -p ${OPENCOLORIO_BUILD_DIR}
46-
cd ${OPENCOLORIO_BUILD_DIR}
47-
time cmake -DCMAKE_BUILD_TYPE=Release \
46+
time cmake -S . -B ${OPENCOLORIO_BUILD_DIR} \
47+
-DCMAKE_BUILD_TYPE=${OPENCOLORIO_BUILD_TYPE} \
4848
-DCMAKE_INSTALL_PREFIX=${OPENCOLORIO_INSTALL_DIR} \
4949
-DCMAKE_CXX_FLAGS="${OPENCOLORIO_CXX_FLAGS}" \
50-
${OPENCOLORIO_BUILDOPTS} ${OPENCOLORIO_SOURCE_DIR}
51-
time cmake --build . --config Release --target install
50+
${OPENCOLORIO_BUILDOPTS}
51+
time cmake --build ${OPENCOLORIO_BUILD_DIR} --config Release --target install
5252
popd
5353

5454
# ls -R ${OPENCOLORIO_INSTALL_DIR}

src/build-scripts/build_openexr.bash

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,28 +36,27 @@ if [[ ! -e ${OPENEXR_SOURCE_DIR} ]] ; then
3636
git clone ${OPENEXR_REPO} ${OPENEXR_SOURCE_DIR}
3737
fi
3838
mkdir -p ${OPENEXR_INSTALL_DIR} && true
39-
mkdir -p ${OPENEXR_BUILD_DIR} && true
4039

4140
pushd ${OPENEXR_SOURCE_DIR}
4241
git checkout ${OPENEXR_VERSION} --force
4342

4443
if [[ ${OPENEXR_VERSION} == "v2.3.0" ]] ; then
4544
# Simplified setup for 2.3+
46-
cd ${OPENEXR_BUILD_DIR}
47-
cmake -DCMAKE_BUILD_TYPE=${OPENEXR_BUILD_TYPE} \
45+
cmake -S . -B ${OPENEXR_BUILD_DIR} \
46+
-DCMAKE_BUILD_TYPE=${OPENEXR_BUILD_TYPE} \
4847
-DCMAKE_INSTALL_PREFIX="${OPENEXR_INSTALL_DIR}" \
4948
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \
5049
-DILMBASE_PACKAGE_PREFIX="${OPENEXR_INSTALL_DIR}" \
5150
-DOPENEXR_BUILD_UTILS=0 \
5251
-DOPENEXR_BUILD_TESTS=0 \
5352
-DOPENEXR_BUILD_PYTHON_LIBS=0 \
5453
-DCMAKE_CXX_FLAGS="${OPENEXR_CXX_FLAGS}" \
55-
${OPENEXR_CMAKE_FLAGS} ${OPENEXR_SOURCE_DIR}
56-
time cmake --build . --target install --config ${OPENEXR_BUILD_TYPE}
54+
${OPENEXR_CMAKE_FLAGS}
55+
time cmake --build ${OPENEXR_BUILD_DIR} --target install --config ${OPENEXR_BUILD_TYPE}
5756
else
5857
# Simplified setup for 2.4+
59-
cd ${OPENEXR_BUILD_DIR}
60-
cmake -DCMAKE_BUILD_TYPE=${OPENEXR_BUILD_TYPE} \
58+
cmake -S . -B ${OPENEXR_BUILD_DIR} \
59+
-DCMAKE_BUILD_TYPE=${OPENEXR_BUILD_TYPE} \
6160
-DCMAKE_INSTALL_PREFIX="${OPENEXR_INSTALL_DIR}" \
6261
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \
6362
-DILMBASE_PACKAGE_PREFIX="${OPENEXR_INSTALL_DIR}" \
@@ -69,8 +68,8 @@ else
6968
-DOPENEXR_INSTALL_EXAMPLES=0 \
7069
-DCMAKE_INSTALL_LIBDIR=lib \
7170
-DCMAKE_CXX_FLAGS="${OPENEXR_CXX_FLAGS}" \
72-
${OPENEXR_CMAKE_FLAGS} ${OPENEXR_SOURCE_DIR}
73-
time cmake --build . --target install --config ${OPENEXR_BUILD_TYPE}
71+
${OPENEXR_CMAKE_FLAGS}
72+
time cmake --build ${OPENEXR_BUILD_DIR} --target install --config ${OPENEXR_BUILD_TYPE}
7473
fi
7574

7675
popd

src/build-scripts/build_pugixml.bash

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,13 @@ cd ${PUGIXML_SRC_DIR}
3838
echo "git checkout ${PUGIXML_VERSION} --force"
3939
git checkout ${PUGIXML_VERSION} --force
4040

41-
mkdir -p ${PUGIXML_BUILD_DIR}
42-
cd ${PUGIXML_BUILD_DIR}
43-
4441
if [[ -z $DEP_DOWNLOAD_ONLY ]]; then
45-
time cmake -DCMAKE_BUILD_TYPE=Release \
42+
time cmake -S . -B ${PUGIXML_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release \
4643
-DCMAKE_INSTALL_PREFIX=${PUGIXML_INSTALL_DIR} \
4744
-DBUILD_SHARED_LIBS=ON \
4845
-DBUILD_TESTS=OFF \
4946
${PUGIXML_BUILD_OPTS} ..
50-
time cmake --build . --config Release --target install
47+
time cmake --build ${PUGIXML_BUILD_DIR} --config Release --target install
5148
fi
5249

5350
# ls -R ${PUGIXML_INSTALL_DIR}

src/build-scripts/build_pybind11.bash

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,12 @@ cd ${PYBIND11_SRC_DIR}
4242
echo "git checkout ${PYBIND11_VERSION} --force"
4343
git checkout ${PYBIND11_VERSION} --force
4444

45-
mkdir -p ${PYBIND11_BUILD_DIR}
46-
cd ${PYBIND11_BUILD_DIR}
47-
4845
if [[ -z $DEP_DOWNLOAD_ONLY ]]; then
49-
time cmake -DCMAKE_BUILD_TYPE=Release \
46+
time cmake -S . -B ${PYBIND11_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release \
5047
-DCMAKE_INSTALL_PREFIX=${PYBIND11_INSTALL_DIR} \
5148
-DPYBIND11_TEST=OFF \
52-
${PYBIND11_BUILD_OPTS} ..
53-
time cmake --build . --config Release --target install
49+
${PYBIND11_BUILD_OPTS}
50+
time cmake --build ${PYBIND11_BUILD_DIR} --config Release --target install
5451
fi
5552

5653
# ls -R ${PYBIND11_INSTALL_DIR}

src/build-scripts/build_webp.bash

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,8 @@ cd ${WEBP_SRC_DIR}
3737
echo "git checkout ${WEBP_VERSION} --force"
3838
git checkout ${WEBP_VERSION} --force
3939

40-
mkdir -p ${WEBP_BUILD_DIR}
41-
cd ${WEBP_BUILD_DIR}
42-
4340
if [[ -z $DEP_DOWNLOAD_ONLY ]]; then
44-
time cmake -DCMAKE_BUILD_TYPE=${WEBP_BUILD_TYPE} \
41+
time cmake -S . -B ${WEBP_BUILD_DIR} -DCMAKE_BUILD_TYPE=${WEBP_BUILD_TYPE} \
4542
-DCMAKE_INSTALL_PREFIX=${WEBP_INSTALL_DIR} \
4643
-DWEBP_BUILD_ANIM_UTILS=OFF \
4744
-DWEBP_BUILD_CWEBP=OFF \
@@ -51,8 +48,8 @@ if [[ -z $DEP_DOWNLOAD_ONLY ]]; then
5148
-DWEBP_BUILD_IMG2WEBP=OFF \
5249
-DWEBP_BUILD_EXTRAS=OFF \
5350
-DBUILD_SHARED_LIBS=ON \
54-
${WEBP_CONFIG_OPTS} ..
55-
time cmake --build . --target install
51+
${WEBP_CONFIG_OPTS}
52+
time cmake --build ${WEBP_BUILD_DIR} --target install
5653
fi
5754

5855

0 commit comments

Comments
 (0)