Modified CMakeLists.txt to use find_package for dependencies.

Fixed up the cmake files so it builds under linux. I haven't tested it rigorously but building it under LinuxLite (Ubuntu-based distro) seems to work.

If there are any problems, feel free to submit an issue or even a patch fix.