Let's say you are minimizing f(x). Suppose you add a variable z to the model, set z = f(x) in a constraint, and set a lower bound on z equal to your desired stopping value (the known optimum, or possibly something a bit larger). The solver will stop when it hits or approaches that bound, (You will need to set the absolute and relative MIP gaps to zero, or close to zero.) For maximizing, do the same but fix the upper bound of z.
The bound set on z may affect preprocessing and decision making in the branch and cut algorithm. Depending on your luck, it might speed solution, or it might slow it down.
#CPLEXOptimizers#DecisionOptimization