cmake: add version detection of dependencies