Modified CMakeLists.txt and Makefiles for example codes.