fix build file bugs.
improved CMake.
update CMakeLists.txt
make CMakeLists.txt flexible.