Add custom cmake scripts for dependency resolving
These were kindly contributed by Daniel Maleike with mostly cosmetic changes.