[CMake] Extract building runtime test as a param (#1870)
author이한종/동작제어Lab(SR)/Engineer/삼성전자 <hanjoung.lee@samsung.com>
Thu, 5 Jul 2018 05:14:11 +0000 (14:14 +0900)
committer이춘석/동작제어Lab(SR)/Staff Engineer/삼성전자 <chunseok.lee@samsung.com>
Thu, 5 Jul 2018 05:14:11 +0000 (14:14 +0900)
Before `add_subdirectory(tests)` was called twice if we run both two
runtimes which causes cmake error.

Signed-off-by: Hanjoung Lee <hanjoung.lee@samsung.com>
runtimes/CMakeLists.txt

index 1043b5f..e108976 100644 (file)
@@ -1,15 +1,21 @@
+set(BUILD_RUNTIME_TESTS OFF)
+
 if(BUILD_NN_RUNTIME)
   set(LIB_RUNTIME runtime)
   add_subdirectory(nn)
-  add_subdirectory(tests)
+  set(BUILD_RUNTIME_TESTS ON)
 endif(BUILD_NN_RUNTIME)
 
 if(BUILD_NEW_RUNTIME)
   set(LIB_NEW_RUNTIME new_runtime)
   add_subdirectory(new_runtime)
-  add_subdirectory(tests)
+  set(BUILD_RUNTIME_TESTS ON)
 endif(BUILD_NEW_RUNTIME)
 
+if(BUILD_RUNTIME_TESTS)
+  add_subdirectory(tests)
+endif(BUILD_RUNTIME_TESTS)
+
 add_subdirectory(template)
 add_subdirectory(logging)
 add_subdirectory(pure_arm_compute)