installing CTest files alongside the installed test binary

Among other things, CTest offers a way to standardize test result outputs. By default, it cmake testing framework issues cmake test files inside the build true.

To keep benefits of CTest outside of the build/install procedure, I’d like to have cmake test files installed along side the test binary (which can be installed in any location provided by the user), in order to be able to launch CTest directly from this location.

What is the best way to achieve that?

The “manual” way would be, I guess, to add a command to the install procedure that copies CTestTestfile.cmake at the installation location but there might be more complex scenario I guess (multiple files to copy, tests data to reference and so on)