Main cmakelists updated to work both with clang and gcc