Better detection of the libXi

I encounter the bug that Xi library was not automatically detected on my unix system.
I suggest to use the cmake find_library tool to detect and use the Xi library.