[CMake] Added a macro for protobuf compilation.