robustly specify executable target

Hello! I use thrift.cmake as git submodule,and do add_subdirectory(${PROJECT_SOURCE_DIR}/ext/thrift_cmake) in my root cmake script.
In this case, CTest can't find test executables.
This patch fixes the problem.