build: Improve test building.
Uses the FindLibcheck and friends at the top level to control BUILD_TESTING (which CTest uses). Adds the test to the project so CTest can see it too. PROJECT_SOURCE_DIR instead of CMAKE_SOURCE_DIR so it doesn't break in case this is a subproject somewhere.
Showing with 19 additions and 14 deletions