Actually, a rather good method is spray adhesive, hit the baseboard with it and then attach it.
Then you run over the edges with a mix of thinned out plaster and white/pva glue to harden the edges.
If you're going with a thicker thing of foam, put some nails through the board that will embed in the foam...make sure they don't go all the way through, though you can use longer nails for areas you want to put other layers of foam. Give the nails a bit of glue before you put the pieces together.
The end result is an extremely good bond and bypasses the problems of spray adhesive directly on the foam...