CMake: generalize dependency handling beyond my own system