Expose package checks as CMake targets

This commit is contained in:
2026-06-05 12:40:22 +02:00
parent 711a9b5037
commit 1dc2ae4f21
6 changed files with 98 additions and 7 deletions

View File

@@ -0,0 +1,50 @@
find_program(PP_POWERSHELL_COMMAND NAMES pwsh powershell)
function(pp_add_powershell_automation_target target_name)
cmake_parse_arguments(PP_PACKAGE_TARGET "" "COMMENT" "ARGUMENTS" ${ARGN})
if(PP_POWERSHELL_COMMAND)
add_custom_target(${target_name}
COMMAND "${PP_POWERSHELL_COMMAND}"
-NoProfile
-ExecutionPolicy Bypass
${PP_PACKAGE_TARGET_ARGUMENTS}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMENT "${PP_PACKAGE_TARGET_COMMENT}"
USES_TERMINAL
VERBATIM)
else()
add_custom_target(${target_name}
COMMAND "${CMAKE_COMMAND}" -E echo "PowerShell was not found; cannot run ${target_name}."
COMMAND "${CMAKE_COMMAND}" -E false
COMMENT "${PP_PACKAGE_TARGET_COMMENT}"
VERBATIM)
endif()
endfunction()
pp_add_powershell_automation_target(panopainter_package_readiness
COMMENT "Report package readiness blockers."
ARGUMENTS
-File "${CMAKE_CURRENT_SOURCE_DIR}/scripts/automation/package-smoke.ps1"
-ReadinessOnly)
pp_add_powershell_automation_target(panopainter_android_standard_native_package
COMMENT "Build retained Android standard native package library."
ARGUMENTS
-File "${CMAKE_CURRENT_SOURCE_DIR}/scripts/automation/android-legacy-package-build.ps1"
-Packages standard)
pp_add_powershell_automation_target(panopainter_android_vr_native_package_configure
COMMENT "Configure retained Android Quest/Focus native package paths."
ARGUMENTS
-File "${CMAKE_CURRENT_SOURCE_DIR}/scripts/automation/android-legacy-package-build.ps1"
-Packages quest,focus
-ConfigureOnly)
pp_add_powershell_automation_target(panopainter_android_native_package_smoke
COMMENT "Run retained Android native package checks through package-smoke."
ARGUMENTS
-File "${CMAKE_CURRENT_SOURCE_DIR}/scripts/automation/package-smoke.ps1"
-ReadinessOnly
-AndroidNativeChecks
-PackageKinds android-standard-apk,android-quest-apk,android-focus-apk)