MLECO-2855: Move profiling outside application/main

Change-Id: I182bfa55b5ae743d6f0b9f5c766b746202a7968d
Signed-off-by: Isabella Gottardi <isabella.gottardi@arm.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9d6ed7c..2743066 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
 #----------------------------------------------------------------------------
-#  Copyright (c) 2021 Arm Limited. All rights reserved.
+#  Copyright (c) 2021 - 2022 Arm Limited. All rights reserved.
 #  SPDX-License-Identifier: Apache-2.0
 #
 #  Licensed under the Apache License, Version 2.0 (the "License");
@@ -170,12 +170,18 @@
 # by each platform's cmake include file
 list(APPEND SRC_HAL ${SRC_PLAT_HAL})
 
+# Profiler
+if (NOT DEFINED PROFILER_DIR)
+    set(PROFILER_DIR ${SRC_PATH}/application/profiler)
+endif ()
+
 # Include directories:
-set(APPLICATION_INCLUDE_DIRS
+list(APPEND APPLICATION_INCLUDE_DIRS
     ${HAL_DIR}/include
     ${SRC_PATH}/application/tensorflow-lite-micro/include
     ${SRC_PATH}/application/main/include
     ${PLAT_INCLUDE_DIRS}
+    ${PROFILER_DIR}/include
     )
 
 file(GLOB_RECURSE SRC_APPLICATION
@@ -185,6 +191,9 @@
     "${SRC_PATH}/application/main/**/*.cc"
     "${SRC_PATH}/application/main/**/*.cpp"
     "${SRC_PATH}/application/main/**/*.c"
+    "${PROFILER_DIR}/*.cc"
+    "${PROFILER_DIR}/*.cpp"
+    "${PROFILER_DIR}/*.c"
     )
 list(FILTER SRC_APPLICATION EXCLUDE REGEX ".*main\\.c.*$")
 
@@ -219,6 +228,11 @@
         )
 endif ()
 
+list(APPEND APPLICATION_LIBS
+        ${TENSORFLOW_LIBRARY}
+        $<$<BOOL:${ETHOS_U_NPU_ENABLED}>:${ETHOS_U_NPU_LIBS}>
+        $<$<BOOL:${CMSIS_DSP_LIB}>:${CMSIS_DSP_LIB}>)
+
 message(STATUS "Building use-cases: ${USE_CASES}.")
 foreach(use_case ${USE_CASES})
 
@@ -322,10 +336,7 @@
         endif()
     endif()
 
-    target_link_libraries(${UC_LIB_NAME} PUBLIC
-        ${TENSORFLOW_LIBRARY}
-        $<$<BOOL:${ETHOS_U_NPU_ENABLED}>:${ETHOS_U_NPU_LIBS}>
-        $<$<BOOL:${CMSIS_DSP_LIB}>:${CMSIS_DSP_LIB}>)
+    target_link_libraries(${UC_LIB_NAME} PUBLIC ${APPLICATION_LIBS})
 
     add_executable(${TARGET_NAME} ${SRC_MAIN} ${PLAT_RETARGET_SOURCE})
 
diff --git a/scripts/cmake/toolchains/bare-metal-armclang.cmake b/scripts/cmake/toolchains/bare-metal-armclang.cmake
index 4852db1..afe6e66 100644
--- a/scripts/cmake/toolchains/bare-metal-armclang.cmake
+++ b/scripts/cmake/toolchains/bare-metal-armclang.cmake
@@ -1,5 +1,5 @@
 #----------------------------------------------------------------------------
-#  Copyright (c) 2021 Arm Limited. All rights reserved.
+#  Copyright (c) 2021 - 2022 Arm Limited. All rights reserved.
 #  SPDX-License-Identifier: Apache-2.0
 #
 #  Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/scripts/cmake/toolchains/bare-metal-gcc.cmake b/scripts/cmake/toolchains/bare-metal-gcc.cmake
index f111746..1ddfb44 100644
--- a/scripts/cmake/toolchains/bare-metal-gcc.cmake
+++ b/scripts/cmake/toolchains/bare-metal-gcc.cmake
@@ -1,5 +1,5 @@
 #----------------------------------------------------------------------------
-#  Copyright (c) 2021 Arm Limited. All rights reserved.
+#  Copyright (c) 2021 - 2022 Arm Limited. All rights reserved.
 #  SPDX-License-Identifier: Apache-2.0
 #
 #  Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/scripts/py/gen_test_data_cpp.py b/scripts/py/gen_test_data_cpp.py
index 3ead8bf..dae181d 100644
--- a/scripts/py/gen_test_data_cpp.py
+++ b/scripts/py/gen_test_data_cpp.py
@@ -1,4 +1,4 @@
-#  Copyright (c) 2021 Arm Limited. All rights reserved.
+#  Copyright (c) 2021 - 2022 Arm Limited. All rights reserved.
 #  SPDX-License-Identifier: Apache-2.0
 #
 #  Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/source/application/main/Profiler.cc b/source/application/profiler/Profiler.cc
similarity index 99%
rename from source/application/main/Profiler.cc
rename to source/application/profiler/Profiler.cc
index fe3aeaf..c2b8f2a 100644
--- a/source/application/main/Profiler.cc
+++ b/source/application/profiler/Profiler.cc
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Arm Limited. All rights reserved.
+ * Copyright (c) 2022 Arm Limited. All rights reserved.
  * SPDX-License-Identifier: Apache-2.0
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/source/application/main/include/Profiler.hpp b/source/application/profiler/include/Profiler.hpp
similarity index 98%
rename from source/application/main/include/Profiler.hpp
rename to source/application/profiler/include/Profiler.hpp
index d1b6d91..503d805 100644
--- a/source/application/main/include/Profiler.hpp
+++ b/source/application/profiler/include/Profiler.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Arm Limited. All rights reserved.
+ * Copyright (c) 2022 Arm Limited. All rights reserved.
  * SPDX-License-Identifier: Apache-2.0
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/tests/common/PlatformMathTests.cpp b/tests/common/PlatformMathTests.cpp
index 2155886..ab1153f 100644
--- a/tests/common/PlatformMathTests.cpp
+++ b/tests/common/PlatformMathTests.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Arm Limited. All rights reserved.
+ * Copyright (c) 2021 - 2022 Arm Limited. All rights reserved.
    * SPDX-License-Identifier: Apache-2.0
  *
  * Licensed under the Apache License, Version 2.0 (the "License");