File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -152,6 +152,21 @@ install(CODE "
152152 endif()
153153" COMPONENT Runtime)
154154
155+ # Install 'swpython.bat' wrapper that launches the bundled Python with
156+ # PYTHONHOME set, and prepends the bundle bin/ to PATH so use case scripts
157+ # can find the shapeworks CLI via shutil.which.
158+ set(_swpython_dir "${CMAKE_BINARY_DIR}/_bundled_python/swpython")
159+ file(MAKE_DIRECTORY "${_swpython_dir}")
160+ file(WRITE "${_swpython_dir}/swpython.bat"
161+ [=[@echo off
162+ set "LOC=%~dp0"
163+ set "PYTHONHOME=%LOC%..\lib\python"
164+ set "PATH=%LOC%;%PATH%"
165+ set "PYTHONPATH="
166+ "%PYTHONHOME%\python.exe" %*
167+ ]=])
168+ install(PROGRAMS "${_swpython_dir}/swpython.bat" DESTINATION bin)
169+
155170message(STATUS "InstallBundledPython: will install bundled Python to ${_python_dest}")
156171return()
157172endif() # WIN32
You can’t perform that action at this time.
0 commit comments