I use CMake to build my system and my unit tests.
I also do the build outside the source.
I found using the ADD_TEST () command that you do not need to install a test executable file (it will be launched only when you run make install, which is great).
However, my unit tests depend on some input files that need to be copied to where the executable is running.
As far as I know, I can not use INSTALL () to copy files there, because I did not indicate where it is - it depends on where the build command is called.
Is there any way that I can tell CMake to copy my test files to the same place where it creates the executable?
source
share