This paper presents a theoretical approach to optimal control problems (OCPs) governed by a class of control systems with discontinuous right-hand sides. A possible application of the framework developed in this paper is constituted by the conventional sliding mode dynamic processes. The general theory of constrained OCPs is used as an analytic background for designing numerically tractable schemes and computational methods for their solutions. The proposed analytic method guarantees consistency of the resulting approximations related to the original infinite-dimensional optimization problem and leads to specific implementable algorithms.