Waterpower as source of industrial power for weapon factories was well developed by at latest, mid 1600s, even in remote Sweden. Don't know when steam was displacing water power. Interior layout of factories did not change much because of transition to steam. Both power sources were external to workshop buildings.
What steam did allow was more flexibility in locating major weapons factories. No longer needed to find nice river or build dam to have power. Steam also allowed, at least in principle, factories to operate independent of rivers icing up, of droughts, of flood damage.
Niklas