Fix public header generation in cmake