aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-13 05:10:58 +0000
committer_ov4 <ov4@ov4.org>2026-10-13 05:10:58 +0000
commit8b633927930095d2a8f6ffd48dc2f88a21b3e0bf (patch)
tree5cb618a90c30757656e27656dad019146fbd4547 /cmake
parent84cbd5fef8c67586f08cb7396f9d60ef4a07622f (diff)
build: invoke the PowerShell installer on Windows
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Install.cmake.in27
1 files changed, 21 insertions, 6 deletions
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()