diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index bf5393d629333aab234d44cb4e7c29f7a6a6380d..ecb911fd36cb09aa1d5ae050755b8a022e7943f1 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,4 +1,4 @@
-if(ADOLC_FOUND AND IPOPT_FOUND AND PYTHONLIBS_FOUND AND dune-uggrid_FOUND)
+if(ADOLC_FOUND AND IPOPT_FOUND AND Python3_FOUND AND dune-uggrid_FOUND)
   set(programs linear-elasticity)
 
   # When combining dune-common 2.7 and dune-fufem 2.8, no cmake test for the