khmrP: Here is the source from Larry Coon's CBA FAQ:
They use a slightly different calculation for determining the team salary in relation to the Bi-Annual, Non-Taxpayer Mid-Level, and Taxpayer Mid-Level exceptions (see question number 25), and for Sign-and-Trade transactions (see question number 88). For these purposes (i.e., for determining whether the team salary is above or below the apron2) they use the team salary as defined above, with the following modifications:
All unlikely bonuses are included for contracts and extensions signed under the current CBA.
Amounts that could be included in team salary as the result of certain grievances are included.
For rookies and players with one year of experience whose salary is less than the two-year minimum salary, the two-year minimum salary is used in place of their actual salary.
For the team's restricted free agents, the amount of any outstanding qualifying offer or first refusal exercise notice (both including unlikely bonuses), whichever is greater, are included.
The amount of any required tenders for the team's draft picks is included.
Cap holds for free agents are excluded.
Cap holds for first round draft picks are excluded.
Cap holds for the team's outstanding exceptions are excluded.
So technically, Dwight's potential salary would not count in a S&T for Smith, since it would not count against the cap apron aka 4M over the luxury tax threshold. LA would first pull off that S&T and then offer Howard his new max deal.