From f9a331a935f85f2efa8bd6db20e8436e26b4c04e Mon Sep 17 00:00:00 2001
From: Sonja Happ <sonja.happ@eonerc.rwth-aachen.de>
Date: Thu, 17 Oct 2019 10:42:53 +0200
Subject: [PATCH] only build unit tests of common if project is toplevel
 project

---
 common/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt
index 7fdab762c..5dcc5f393 100644
--- a/common/CMakeLists.txt
+++ b/common/CMakeLists.txt
@@ -63,7 +63,7 @@ pkg_check_modules(JANSSON IMPORTED_TARGET REQUIRED jansson>=2.7)
 pkg_check_modules(LIBCONFIG IMPORTED_TARGET libconfig>=1.4.9)
 
 add_subdirectory(lib)
-if(CRITERION_FOUND)
+if(CRITERION_FOUND AND TOPLEVEL_PROJECT)
     add_subdirectory(tests)
 endif()