updated CMakeLists for dynamic compilation