Skip to content

Commit 2dca3c8

Browse files
author
Simon Rit
committed
ENH: Pass setup.py and cmake options in PowerShell module script
1 parent cc3cbd2 commit 2dca3c8

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

scripts/windows-download-cache-and-build-module-wheels.ps1

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@
1111
#
1212
# > windows-download-cache-and-build-module-wheels.ps1 11
1313
#
14+
# - other parameters are passed to setup.py. If one of the parameters is "--",
15+
# the following parameters will be passed to cmake.
16+
# For instance, for Python 3.11, excluding nvcuda.dll during packaging
17+
# and setting RTK_USE_CUDA ON during configuration:
18+
#
19+
# > windows-download-cache-and-build-module-wheels.ps1 11 --exclude-libs nvcuda.dll "--" -DRTK_USE_CUDA:BOOL=ON
20+
#
21+
#
1422
# -----------------------------------------------------------------------
1523
# Environment variables used in this script:
1624
#
@@ -71,7 +79,14 @@ $env:Path += ";C:\P\grep"
7179

7280
# Build ITK module dependencies, if any
7381
$build_command = "& `"C:\Python$pythonVersion-x$pythonArch\python.exe`" `"C:\P\IPP\scripts\windows_build_module_wheels.py`" --no-cleanup --py-envs `"3$($args[0])-x64`""
74-
echo "Build command: $build_command"
82+
foreach ($arg in $args[1..$args.length]) {
83+
if ($arg.substring(0,2) -eq "--") {
84+
$build_command = "$build_command $($arg)"
85+
}
86+
else {
87+
$build_command = "$build_command `"$($arg)`""
88+
}
89+
}
7590

7691
echo "ITK_MODULE_PREQ: $env:ITK_MODULE_PREQ $ITK_MODULE_PREQ"
7792
if ($env:ITK_MODULE_PREQ) {

0 commit comments

Comments
 (0)