From eb403bb7b42ddb59c8621997400c37787d753708 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 19 Mar 2024 19:00:02 -0400 Subject: Tests: Pass path to WiX 3 into RunCMake.CPack_WIX test Avoid requiring its location to be in the PATH environment variable. --- .gitlab/ci/configure_windows_arm64_vs2022_ninja.cmake | 2 +- .gitlab/ci/configure_windows_vs2022_x64_ninja.cmake | 2 +- .gitlab/ci/configure_windows_wix_common.cmake | 2 ++ .gitlab/ci/env_windows_arm64_vs2022_ninja.ps1 | 2 +- .gitlab/ci/env_windows_vs2022_x64_ninja.ps1 | 2 +- Tests/RunCMake/CMakeLists.txt | 6 ++++-- Tests/RunCMake/CPack_WIX/RunCMakeTest.cmake | 2 ++ 7 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 .gitlab/ci/configure_windows_wix_common.cmake diff --git a/.gitlab/ci/configure_windows_arm64_vs2022_ninja.cmake b/.gitlab/ci/configure_windows_arm64_vs2022_ninja.cmake index be9ce12..cd9780b 100644 --- a/.gitlab/ci/configure_windows_arm64_vs2022_ninja.cmake +++ b/.gitlab/ci/configure_windows_arm64_vs2022_ninja.cmake @@ -3,9 +3,9 @@ set(CMake_TEST_GUI "OFF" CACHE BOOL "") set(BUILD_QtDialog "OFF" CACHE BOOL "") set(CMAKE_PREFIX_PATH "" CACHE STRING "") -set(CMake_TEST_CPACK_WIX "ON" CACHE BOOL "") set(CMake_TEST_TLS_VERIFY_URL "https://gitlab.kitware.com" CACHE STRING "") set(CMake_TEST_TLS_VERSION "1.2" CACHE STRING "") include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_msvc_cxx_modules_common.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_wix_common.cmake") include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_vs_common_ninja.cmake") diff --git a/.gitlab/ci/configure_windows_vs2022_x64_ninja.cmake b/.gitlab/ci/configure_windows_vs2022_x64_ninja.cmake index c32c8e2..7321e10 100644 --- a/.gitlab/ci/configure_windows_vs2022_x64_ninja.cmake +++ b/.gitlab/ci/configure_windows_vs2022_x64_ninja.cmake @@ -4,9 +4,9 @@ if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "") set(CMake_TEST_Swift "ON" CACHE STRING "") endif() -set(CMake_TEST_CPACK_WIX "ON" CACHE BOOL "") set(CMake_TEST_TLS_VERIFY_URL "https://gitlab.kitware.com" CACHE STRING "") set(CMake_TEST_TLS_VERSION "1.2" CACHE STRING "") include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_msvc_cxx_modules_common.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_wix_common.cmake") include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_vs_common_ninja.cmake") diff --git a/.gitlab/ci/configure_windows_wix_common.cmake b/.gitlab/ci/configure_windows_wix_common.cmake new file mode 100644 index 0000000..faf2464 --- /dev/null +++ b/.gitlab/ci/configure_windows_wix_common.cmake @@ -0,0 +1,2 @@ +get_filename_component(wix3_dir "${CMAKE_CURRENT_LIST_DIR}/../wix3" ABSOLUTE) +set(CMake_TEST_CPACK_WIX3 "${wix3_dir}" CACHE PATH "") diff --git a/.gitlab/ci/env_windows_arm64_vs2022_ninja.ps1 b/.gitlab/ci/env_windows_arm64_vs2022_ninja.ps1 index a898007..b0085d2 100755 --- a/.gitlab/ci/env_windows_arm64_vs2022_ninja.ps1 +++ b/.gitlab/ci/env_windows_arm64_vs2022_ninja.ps1 @@ -1 +1 @@ -. .gitlab/ci/wix3-env.ps1 +& "$pwsh" -File .gitlab/ci/wix3.ps1 diff --git a/.gitlab/ci/env_windows_vs2022_x64_ninja.ps1 b/.gitlab/ci/env_windows_vs2022_x64_ninja.ps1 index 0649b9f..9dde3a2 100755 --- a/.gitlab/ci/env_windows_vs2022_x64_ninja.ps1 +++ b/.gitlab/ci/env_windows_vs2022_x64_ninja.ps1 @@ -4,4 +4,4 @@ if ("$env:CMAKE_CI_NIGHTLY" -eq "true") { . ".gitlab/ci/swift-env.ps1" } -. .gitlab/ci/wix3-env.ps1 +& "$pwsh" -File .gitlab/ci/wix3.ps1 diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index a541e8d..ffd55f8 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -1097,8 +1097,10 @@ endif() add_RunCMake_test_group(CPack "${cpack_tests}") -if(CMake_TEST_CPACK_WIX) - add_RunCMake_test(CPack_WIX) +if(CMake_TEST_CPACK_WIX3) + add_RunCMake_test(CPack_WIX + -DCMake_TEST_CPACK_WIX3=${CMake_TEST_CPACK_WIX3} + ) endif() # add a test to make sure symbols are exported from a shared library diff --git a/Tests/RunCMake/CPack_WIX/RunCMakeTest.cmake b/Tests/RunCMake/CPack_WIX/RunCMakeTest.cmake index 1e81497..cd525d0 100644 --- a/Tests/RunCMake/CPack_WIX/RunCMakeTest.cmake +++ b/Tests/RunCMake/CPack_WIX/RunCMakeTest.cmake @@ -2,4 +2,6 @@ include(RunCPack) set(RunCPack_GENERATORS WIX) +set(ENV{PATH} "${CMake_TEST_CPACK_WIX3};$ENV{PATH}") + run_cpack(AppWiX BUILD GLOB *.msi VERIFY powershell -ExecutionPolicy Bypass -File ${CMAKE_CURRENT_LIST_DIR}/print-msi.ps1) -- cgit v0.12