diff --git a/src/pystencilssfg/cmake/FindPystencilsSfg.cmake b/src/pystencilssfg/cmake/FindPystencilsSfg.cmake
index c1affee445227ed3e0903b7fdcf7a68731f732db..a5e7b11d09ddb55da6802291a28be77d6a44f4f6 100644
--- a/src/pystencilssfg/cmake/FindPystencilsSfg.cmake
+++ b/src/pystencilssfg/cmake/FindPystencilsSfg.cmake
@@ -13,8 +13,10 @@ if(${_PystencilsSfgFindResult} EQUAL 0)
     set( PystencilsSfg_FOUND ON )
 endif()
 
-if(${PystencilsSfg_FIND_REQUIRED} AND (NOT ${PystencilsSfg_FOUND}))
-    message( FATAL_ERROR "Could not find pystencils-sfg in current Python environment." )
+if(DEFINED PystencilsSfg_FIND_REQUIRED)
+    if(NOT ${PystencilsSfg_FOUND})
+        message( FATAL_ERROR "Could not find pystencils-sfg in current Python environment." )
+    endif()
 endif()
 
 if(${PystencilsSfg_FOUND})