aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
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 /CMakeLists.txt
parent84cbd5fef8c67586f08cb7396f9d60ef4a07622f (diff)
build: invoke the PowerShell installer on Windows
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index baf337a..508e61a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,14 @@
cmake_minimum_required(VERSION 3.13)
project(cps_compiler)
+if(WIN32 AND CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+ if("$ENV{LOCALAPPDATA}" STREQUAL "")
+ message(FATAL_ERROR "LOCALAPPDATA is unset; specify -DCMAKE_INSTALL_PREFIX explicitly")
+ endif()
+ file(TO_CMAKE_PATH "$ENV{LOCALAPPDATA}/Programs/cpsc" cpsc_default_prefix)
+ set(CMAKE_INSTALL_PREFIX "${cpsc_default_prefix}" CACHE PATH "Installation directory" FORCE)
+endif()
+
set(CPSC_RUN_MODE "" CACHE STRING "Execution mode: PATH, EMBEDDED or NONE (required)")
set_property(CACHE CPSC_RUN_MODE PROPERTY STRINGS PATH EMBEDDED NONE)
if(NOT CPSC_RUN_MODE MATCHES "^(PATH|EMBEDDED|NONE)$")