Find default build location for Compute Library binaries.
authorMatthew Bentham <matthew.bentham@arm.com>
Wed, 20 May 2020 09:44:18 +0000 (10:44 +0100)
committerKevin May <kevin.may@arm.com>
Fri, 22 May 2020 14:01:37 +0000 (14:01 +0000)
In common cases this reduces the cmake arguments needed
for Compute Library from:
"cmake -DARMCOMPUTENEON=1 -DARMCOMPUTECL=1 -DARMCOMPUTE_ROOT=../ComputeLibrary -DARMCOMPUTE_BUILD_DIR=ARMCOMPUTE_BUILD_DIR=../ComputeLibrary/build -DSHARED_BOOST=1 ../armnn/"
to:
"cmake -DARMCOMPUTENEON=1 -DARMCOMPUTECL=1 -DARMCOMPUTE_ROOT=../ComputeLibrary -DSHARED_BOOST=1 ../armnn/"

Signed-off-by: Matthew Bentham <matthew.bentham@arm.com>
Change-Id: I992f4ef428f10dc92ca9457fe8981ae3af93f538

cmake/GlobalConfig.cmake

index 968642b..4e20cc7 100644 (file)
@@ -238,6 +238,11 @@ if(ARMCOMPUTENEON OR ARMCOMPUTECL)
         # We link to the static variant so that customers don't need to find and build a compatible version of clframework.
         # First try the folders specified ARMCOMPUTE_BUILD_DIR (with PATH_SUFFIXES for
         # Windows builds)
+        if ((NOT DEFINED ARMCOMPUTE_BUILD_DIR) AND (DEFINED ARMCOMPUTE_ROOT))
+            # Default build directory for ComputeLibrary is under the root
+            set(ARMCOMPUTE_BUILD_DIR ${ARMCOMPUTE_ROOT}/build)
+        endif()
+
         find_library(ARMCOMPUTE_LIBRARY_DEBUG NAMES arm_compute-static
                      PATHS ${ARMCOMPUTE_BUILD_DIR}
                      PATH_SUFFIXES "Debug"