Updated CMakeLists.txt to improve library generation.