Rewrite CMakeLists.txt files

Too much changes as for a single commit, the major are:
 * Utilize Debug/Release cmake build targets.
 * Implement in-source and standalone builds for example application.