Cut the squash into large wedges and scoop out the seeds. Place on a baking sheet, drizzle with olive, season with salt and pepper. If using, lay a small sprig of rosemary on top of each wedge.
Bake in a hot (200C/400F) oven for about 30-45 minutes, or until the squash is soft.
Remove from oven and let the squash cool completely. Remove the rosemary, then scoop out the pulp and transfer to a mixing bowl. Discard the skins.
Add to the mixing bowl, the rest of the basic filling ingredients and mix vigorously until you have a smooth and uniform mixture. (If you prefer, you can also do this in a food processor or using a stick blender.)
If using, fold in the cubed cheese and meats.
Line a well greased pie plate or quiche dish with the pastry, letting an extra dough hang over the sides. Pour in the filling and flatten it out with a spatula. Now you can fold any extra pastry dough back over the filling, or braid it to form a decorative [border] or just trim it off, as you prefer.
Bake in a pre-heated moderate (180C/350F) oven for 45-60 minutes, or until the filling is cooked through and the pastry has lightly browned.
Remove from the oven and let cool.
Serve lukewarm or at room temperature.