create CMake config.
change check version.
(see http://www.cmake.org/Wiki/CMake/Tutorials/Packaging)
support Xcode build.
Merge pull request #3 from nicdk/master

CMake support