Preheat the oven to 400°F (200°C). Cut the tomatoes in half.
Arrange the tomatoes and garlic on a baking sheet. Drizzle with 1 tablespoon olive oil and season with salt and pepper.
Roast for 35–45 minutes, until the tomatoes are soft and lightly caramelized. Let cool slightly, then peel the garlic.
Toast the pine nuts in a dry skillet over medium heat for 2–3 minutes, until lightly golden. Let cool.
Transfer the pine nuts to a food processor.
Blend until finely ground.
Add the roasted tomatoes, roasted garlic, basil, olive oil, lemon juice, salt, pepper, and red pepper flakes.
Add Parmesan cheese.
Pulse until smooth or leave slightly chunky, depending on your preference. If needed, add another tablespoon of olive oil for a thinner consistency.
Taste and adjust the seasoning before serving.