Restructure interface choosing in cmake