Overriding CPack version from command line not working

I have the same issue and I think something broke in CPack. The OpenCL-SDK does something very similar, it overrides CPACK_SOURCE_IGNORE_FILES on the CLI, and this used to work for the v2022.05.18 release, but in the v2023.02.06 release the ignored files started showing up again in the source ZIP files. I tried reverting to older versions on my local box, but that’s not the issue. I don’t know what is, but the override effect clearly doesn’t work.

(This is one of the very annoying aspects of the Windows runners in GitHub Actions, is that there’s no way to containerize the builds and we’re constantly subject to tool versions changing under us breaking builds/releases.)

FWIW, I also tried whether:

  • CMake/CPack being on the PATH makes a difference
  • using CPACK_PROPERTIES_FILE

The only thing that seems to work is to hang CPack-related commands onto CMake configuration, before including CPack.cmake. Nothing overrides the contents of the generated files.