Creating a Projection Matrix

Hello,
I want to create an optimization on a projection matrix, i.e a matrix whose eigenvalues are only 0 or 1. And I don’t konw how to define it.
Thanks

This cannot be done in CVX, as it is non-convex.