51 lines
2.1 KiB
CMake
51 lines
2.1 KiB
CMake
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)
|