Shorten the add_definitions command test directory and target names to avoid creating really long paths that fail with some tools on Windows. While at it, remove unnecessary project() command calls.