reorganize deleting plugins
add cmake code for debugging