Recently, a new approach for optimization of conditional value-at-risk (CVAR) was suggested and tested with several applications. For continuous distributions, CVAR is defined as the expected loss exceeding value-at-risk (VAR). However, generally, CVAR is the weighted average of VAR and losses exceeding VAR. Central to the approach is an optimization technique for calculating VAR and optimizing CVAR simultaneously. This paper extends this approach to the optimization problems with CVAR constraints. In particular, the approach can be used for maximizing expected returns under CVAR constraints. Multiple CVAR constraints with various confidence levels can be used to shape the profit/loss distribution. A case study for the portfolio of S&P100 stocks is performed to demonstrate how the new optimization techniques can be implemented.