Help with packaging a test suite + main project together

Yes, the project already uses some support scripts which do something similar. However, it is just replacing various paths in a pre-packaged CTestTestfile.cmake after finding the local binary paths etc. I suppose the test config/build could be done entirely on the target machine as you say, but I’d rather not completely rewrite those scripts which are already working.

Anyways, I was able to get a working solution using the CMAKE_PROJECT_CONFIG_FILE. I realized from reading another thread here that I guess the preferred/recommended way to pass config data to files like that is to use configure_file.

Sorry if my last post was overly negative / ranting, but I really was at my wits end and just feeling completely lost and frustrated.
And although I now have a solution to my main issue, I am still genuinely very confused about every other point I mentioned there (aside from the CMAKE_PROJECT_CONFIG_FILE “scope” issue).
So I would greatly appreciate any explanations that can be given to help me understand what was going on there.

For example, is it just that NSIS generator does not make use of many of those variables I mentioned?