We present an approach for modeling nanoscale wetting and dewetting of liquid surfaces that exploits recently developed, sophisticated techniques for computing van der Waals (vdW) or (more generally) Casimir forces in arbitrary geometries. We solve the variational formulation of the Young--Laplace equation to predict the equilibrium shapes of fluid--vacuum interfaces near solid gratings and show that the non-additivity of vdW interactions can have a significant impact on the shape and wetting properties of the liquid surface, leading to very different surface profiles and wetting transitions compared to predictions based on commonly employed additive approximations, such as Hamaker or Derjaguin approximations.