[cmake] move dependency finding to root CMakeLists.txt

In this way, custom include directories for the dependencies are
also available for tools/ and the bindings.  This is necessary for
example when someone is using custom built dependencies which are
not installed in the system's default directories (e.g. OpenCV includes
are required in tools/ through io.hpp)