Turret "X" was lowered into position by a huge crane during construction, and the guns installed afterward. There are huge rollers under the gun turret for turning.
German ships did not affix their gun turrets to the ship, they simply stayed put because of their massive weight. I wonder if British and American ships did the same thing?