cmake: support PTT tests on Windows via ctest

PTT tests depend on CMAKE_HOST_UNIX.  They really depend on bash, though.

Use the FindUnixCommands cmake module to find bash and change the PTT dependency
from CMAKE_HOST_UNIX to BASH.

We further need to refer to the pttc, ptdump, and ptxed tools the proper way
since they end up at different locations on Windows.  Change the hard-coded path
to $<TARGET_FILE:target>.

We further can't use the script/test.bash script as command since cmake replaces
/ with \ for commands.  At least it does not work when using git-bash.  Change
the command to ${BASH} and pass script/test.bash as first argument.

Change-Id: I7f889405c3dae3727efa636028a1d3d983c383c2
Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>
2 files changed