Github #208 Search for flatc on standard paths

Change-Id: Ib5a77dc4b654c67d79f1f53e783b319c885b5215
Signed-off-by: Matthew Bentham <matthew.bentham@arm.com>
diff --git a/src/armnnSerializer/CMakeLists.txt b/src/armnnSerializer/CMakeLists.txt
index af2262d..225999b 100755
--- a/src/armnnSerializer/CMakeLists.txt
+++ b/src/armnnSerializer/CMakeLists.txt
@@ -3,10 +3,17 @@
 # SPDX-License-Identifier: MIT
 #
 if(BUILD_ARMNN_SERIALIZER)
+    find_program(FLATC flatc
+                 HINTS ${FLATC_DIR}
+                 DOC "Path to 'flatc', the flatbuffers compiler")
+    if (NOT FLATC)
+        message(SEND_ERROR "flatc not found. Specify the full path of the flatc executable with -DFLATC=<flatc path>")
+    endif()
+
     add_custom_command(
         # Generate an ArmnnSchema_generated.h file if it doesn't exist, or update it when necessary otherwise
         OUTPUT ArmnnSchema_generated.h DEPENDS ArmnnSchema.fbs
-        COMMAND ${FLATC_DIR}/flatc -o ${CMAKE_CURRENT_BINARY_DIR} --cpp ${CMAKE_CURRENT_SOURCE_DIR}/ArmnnSchema.fbs
+        COMMAND ${FLATC} -o ${CMAKE_CURRENT_BINARY_DIR} --cpp ${CMAKE_CURRENT_SOURCE_DIR}/ArmnnSchema.fbs
     )
 
     set(armnn_serializer_sources)