From 8b633927930095d2a8f6ffd48dc2f88a21b3e0bf Mon Sep 17 00:00:00 2001 From: _ov4 Date: Tue, 13 Oct 2026 05:10:58 +0000 Subject: build: invoke the PowerShell installer on Windows Co-Authored-By: Claude Fable 5.1 --- cmake/Install.cmake.in | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'cmake') diff --git a/cmake/Install.cmake.in b/cmake/Install.cmake.in index 68ecb46..b4d2c8f 100644 --- a/cmake/Install.cmake.in +++ b/cmake/Install.cmake.in @@ -7,12 +7,27 @@ if(NOT cpsc_doc_result STREQUAL "0") message(FATAL_ERROR "Cannot build the manual; make sure Pandoc is installed") endif() -execute_process( - COMMAND sh "@CMAKE_CURRENT_SOURCE_DIR@/install.sh" - --source-dir "@CMAKE_CURRENT_BINARY_DIR@" - --prefix "${CMAKE_INSTALL_PREFIX}" - RESULT_VARIABLE cpsc_install_result -) +set(cpsc_install_windows "@WIN32@") +if(cpsc_install_windows) + find_program(cpsc_powershell NAMES powershell.exe) + if(NOT cpsc_powershell) + message(FATAL_ERROR "Windows installation requires Windows PowerShell (powershell.exe)") + endif() + execute_process( + COMMAND "${cpsc_powershell}" -NoProfile -NonInteractive -ExecutionPolicy Bypass + -File "@CMAKE_CURRENT_SOURCE_DIR@/install.ps1" + -SourceDir "@CMAKE_CURRENT_BINARY_DIR@" + -Prefix "${CMAKE_INSTALL_PREFIX}" + RESULT_VARIABLE cpsc_install_result + ) +else() + execute_process( + COMMAND sh "@CMAKE_CURRENT_SOURCE_DIR@/install.sh" + --source-dir "@CMAKE_CURRENT_BINARY_DIR@" + --prefix "${CMAKE_INSTALL_PREFIX}" + RESULT_VARIABLE cpsc_install_result + ) +endif() if(NOT cpsc_install_result STREQUAL "0") message(FATAL_ERROR "cpsc installation failed (${cpsc_install_result})") endif() -- cgit v1.3.1-4-g156e