Tidy cmake, separate configuration flags (#2008)
author박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Thu, 19 Jul 2018 03:02:17 +0000 (12:02 +0900)
committer이춘석/동작제어Lab(SR)/Staff Engineer/삼성전자 <chunseok.lee@samsung.com>
Thu, 19 Jul 2018 03:02:17 +0000 (12:02 +0900)
This will extract configuration flags to separate file

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
CMakeLists.txt
cmake/CfgOptionFlags.cmake [new file with mode: 0644]

index 80437d3..1fc340b 100644 (file)
@@ -30,28 +30,8 @@ foreach(FLAG ${FLAGS_CXXONLY})
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAG}")
 endforeach()
 
-#
 # Configuration flags
-#
-option(BUILD_ACL "Build ARM Compute Library" OFF)
-option(BUILD_PURE_ARM_COMPUTE "Build pure_arm_compute runtime" ON)
-option(BUILD_ACL_STATIC_LIB "Build ARM Comput Static Library" OFF)
-option(BUILD_BENCHMARK_ACL "Build ARM Compute Library Benchmarks" OFF)
-option(BUILD_NN_RUNTIME "Build NN Runtime" OFF)
-option(BUILD_NEW_RUNTIME "Build New Runtime" OFF) #if implementation is done, it would replace nn runtime.
-option(BUILD_LABS "Build lab projects" ON)
-option(BUILD_ANDROID_NN_RUNTIME_TEST "Build Android NN Runtime Test" ON)
-option(BUILD_DETECTION_APP "Build detection example app" OFF)
-
-if("${TARGET_ARCH}" STREQUAL "armv7l" AND NOT "${TARGET_OS}" STREQUAL "tizen")
-  set(BUILD_PURE_ARM_COMPUTE ON)
-endif()
-
-# On x86, disable pureacl/new runtine build which depends on arm compute library
-if("${TARGET_ARCH}" STREQUAL "x86_64")
-  set(BUILD_PURE_ARM_COMPUTE OFF)
-  set(BUILD_NEW_RUNTIME OFF)
-endif()
+include("cmake/CfgOptionFlags.cmake")
 
 # NOTE '${CMAKE_INSTALL_PREFIX}/lib' should be added as a link directory as
 #      CI server places pre-built ARM compute libraries on this directory.
diff --git a/cmake/CfgOptionFlags.cmake b/cmake/CfgOptionFlags.cmake
new file mode 100644 (file)
index 0000000..2abd102
--- /dev/null
@@ -0,0 +1,22 @@
+#
+# Configuration flags
+#
+option(BUILD_ACL "Build ARM Compute Library" OFF)
+option(BUILD_PURE_ARM_COMPUTE "Build pure_arm_compute runtime" ON)
+option(BUILD_ACL_STATIC_LIB "Build ARM Comput Static Library" OFF)
+option(BUILD_BENCHMARK_ACL "Build ARM Compute Library Benchmarks" OFF)
+option(BUILD_NN_RUNTIME "Build NN Runtime" OFF)
+option(BUILD_NEW_RUNTIME "Build New Runtime" OFF) #if implementation is done, it would replace nn runtime.
+option(BUILD_LABS "Build lab projects" ON)
+option(BUILD_ANDROID_NN_RUNTIME_TEST "Build Android NN Runtime Test" ON)
+option(BUILD_DETECTION_APP "Build detection example app" OFF)
+
+if("${TARGET_ARCH}" STREQUAL "armv7l" AND NOT "${TARGET_OS}" STREQUAL "tizen")
+  set(BUILD_PURE_ARM_COMPUTE ON)
+endif()
+
+# On x86, disable pureacl/new runtine build which depends on arm compute library
+if("${TARGET_ARCH}" STREQUAL "x86_64")
+  set(BUILD_PURE_ARM_COMPUTE OFF)
+  set(BUILD_NEW_RUNTIME OFF)
+endif()