Improved CMake

Modifications have been included in the CMakeLists in order to improve the compilation process.