To solve the given optimization problem, we first need to define the decision variables and the objective function. Let's denote the number of cakes made as \(x_c\) and the number of pies made as \(x_p\).

The objective is to maximize revenue. Given that each cake generates $4 in revenue and each pie generates $3 in revenue, our objective function can be written as:
\[ \text{Maximize} \quad 4x_c + 3x_p \]

We have constraints based on the availability of sugar and flour. For sugar, each cake requires 4 units, and each pie requires 5 units, with a total of 1000 units available. This gives us the constraint:
\[ 4x_c + 5x_p \leq 1000 \]

For flour, each cake requires 5 units, and each pie requires 3 units, with a total of 1200 units available. Thus, we have:
\[ 5x_c + 3x_p \leq 1200 \]

Additionally, \(x_c\) and \(x_p\) must be non-negative since they represent the number of cakes and pies made.

Now, let's translate this into Gurobi code in Python:

```python
from gurobipy import *

# Create a new model
m = Model("Dessert_Factory")

# Define decision variables
x_c = m.addVar(lb=0, vtype=GRB.CONTINUOUS, name="cakes")
x_p = m.addVar(lb=0, vtype=GRB.CONTINUOUS, name="pies")

# Set the objective function
m.setObjective(4*x_c + 3*x_p, GRB.MAXIMIZE)

# Add constraints
m.addConstr(4*x_c + 5*x_p <= 1000, "sugar_limit")
m.addConstr(5*x_c + 3*x_p <= 1200, "flour_limit")

# Optimize the model
m.optimize()

# Print the results
if m.status == GRB.OPTIMAL:
    print("Optimal solution found:")
    print(f"Cakes: {x_c.x}")
    print(f"Pies: {x_p.x}")
    print(f"Revenue: ${4*x_c.x + 3*x_p.x}")
else:
    print("No optimal solution found")
```