Refactoring of the CMakeLists.txt