Made the CMakeLists.txt contain debug and static/shared library
selector, fixed some warnings.