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#
@@ -37,7 +45,12 @@ iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.co
3745
3846if (-not $env: ITK_PACKAGE_VERSION ) { $env: ITK_PACKAGE_VERSION = ' v5.3.0' }
3947echo " Fetching build archive $env: ITK_PACKAGE_VERSION "
40- Invoke-WebRequest - Uri " https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/$env: ITK_PACKAGE_VERSION /ITKPythonBuilds-windows.zip" - OutFile " ITKPythonBuilds-windows.zip"
48+ if (Test-Path C:\P) {
49+ Remove-Item - Recurse - Force C:\P
50+ }
51+ if (-not (Test-Path ITKPythonBuilds- windows.zip)) {
52+ Invoke-WebRequest - Uri " https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/$env: ITK_PACKAGE_VERSION /ITKPythonBuilds-windows.zip" - OutFile " ITKPythonBuilds-windows.zip"
53+ }
41547z x ITKPythonBuilds- windows.zip - oC:\P - aoa - r
4255
4356# Optional: Update ITKPythonPackage build scripts
@@ -63,15 +76,26 @@ if ($env:ITKPYTHONPACKAGE_TAG) {
6376}
6477
6578# Get other build dependencies
66- Invoke-WebRequest - Uri " https://data.kitware.com/api/v1/file/5c0ad59d8d777f2179dd3e9c/download" - OutFile " doxygen-1.8.11.windows.bin.zip"
79+ if (-not (Test-Path doxygen- 1.8 .11. windows.bin.zip)) {
80+ Invoke-WebRequest - Uri " https://data.kitware.com/api/v1/file/5c0ad59d8d777f2179dd3e9c/download" - OutFile " doxygen-1.8.11.windows.bin.zip"
81+ }
67827z x doxygen- 1.8 .11. windows.bin.zip - oC:\P\doxygen - aoa - r
68- Invoke-WebRequest - Uri " https://data.kitware.com/api/v1/file/5bbf87ba8d777f06b91f27d6/download/grep-win.zip" - OutFile " grep-win.zip"
83+ if (-not (Test-Path grep- win.zip)) {
84+ Invoke-WebRequest - Uri " https://data.kitware.com/api/v1/file/5bbf87ba8d777f06b91f27d6/download/grep-win.zip" - OutFile " grep-win.zip"
85+ }
69867z x grep- win.zip - oC:\P\grep - aoa - r
7087$env: Path += " ;C:\P\grep"
7188
7289# Build ITK module dependencies, if any
7390$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 "
91+ foreach ($arg in $args [1 .. $args.length ]) {
92+ if ($arg.substring (0 , 2 ) -eq " --" ) {
93+ $build_command = " $build_command $ ( $arg ) "
94+ }
95+ else {
96+ $build_command = " $build_command `" $ ( $arg ) `" "
97+ }
98+ }
7599
76100echo " ITK_MODULE_PREQ: $env: ITK_MODULE_PREQ $ITK_MODULE_PREQ "
77101if ($env: ITK_MODULE_PREQ ) {
0 commit comments