Deductions & credits

We are installing a solar pavillion with solar panels on it's roof to provide electricity to our primary residence.  Does the cost of the solar pavilion (it serves as supporting structure for the solar panels) count towards the 30% tax credit?  Does the solar pavilion and the solar panels have to be permitted together as a "solar system" to qualify for the rebate or can they be built/permitted separately?