fixed cmake to build using external modules