MLECO-2752: Minor refactoring for native global steps.

And further optimisations of extendability for platform build
steps. Added a list for excluded use-cases.

Change-Id: I5a9398bbeb595a5bf2ea39b81623e4f20238f948
Signed-off-by: alexander <alexander.efremov@arm.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5a7f1f2..51e21eb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -57,7 +57,8 @@
 endif()
 
 include(${CMAKE_SCRIPTS_DIR}/common_user_options.cmake)
-include(${CMAKE_SCRIPTS_DIR}/platforms/${TARGET_PLATFORM}/build_configuration.cmake)
+
+add_platform_build_configuration(TARGET_PLATFORM ${TARGET_PLATFORM})
 
 set_platform_global_defaults()
 
@@ -88,9 +89,6 @@
 set(TEST_SRCS  ${CMAKE_CURRENT_SOURCE_DIR}/tests)
 list(APPEND USE_CASES_TESTS_SEARCH_DIR_LIST ${TEST_SRCS}/use_case)
 
-if (CPU_PROFILE_ENABLED)
-    set(PROFILING_OPT "${PROFILING_OPT} -DCPU_PROFILE_ENABLED")
-endif()
 # We include log target
 add_subdirectory(${SRC_PATH}/log ${CMAKE_BINARY_DIR}/log)
 
@@ -147,6 +145,8 @@
     set(USE_CASES ${USE_CASE_BUILD})
 endif()
 
+list(REMOVE_ITEM USE_CASES "" ${EXCLUDED_USE_CASES})
+message(STATUS "Use-cases excluded by platform configuration: ${EXCLUDED_USE_CASES}")
 message(STATUS "Building use-cases: ${USE_CASES}.")
 foreach(use_case ${USE_CASES})
 
@@ -220,6 +220,10 @@
     target_compile_definitions(${UC_LIB_NAME} PUBLIC
             "ACTIVATION_BUF_SZ=${${use_case}_ACTIVATION_BUF_SZ}")
 
+    # Set the CPU profiling defintiion
+    target_compile_definitions(${UC_LIB_NAME} PRIVATE
+            $<$<BOOL:${CPU_PROFILE_ENABLED}>:CPU_PROFILE_ENABLED>)
+
     target_link_libraries(${UC_LIB_NAME} PUBLIC
         log
         arm_math