diff --git a/CMakeLists.txt b/CMakeLists.txt
index dbf545e552778eb05dc9335e4b21ac54da047cf2..95530e23a154175eac8a303897f73a91fe6432f5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -30,6 +30,11 @@ find_package( URIParser REQUIRED )
 find_package( MsgPack REQUIRED )
 find_package( Eigen3 REQUIRED )
 
+if (WITH_OPTFLOW)
+	# TODO check that cudaoptflow.hpp exists (OpenCV built with correct contrib modules)
+	set(HAVE_OPTFLOW true)
+endif()
+
 find_package( LibArchive )
 if (LibArchive_FOUND)
 	set(HAVE_LIBARCHIVE true)