add_definitions(-DOBS_BUILD)
endif(OBS_BUILD)
+nnfw_include(ExtendCMakeFunction)
+
# TODO For now Android build is being enabled incrementally so not all subdirectories are added yet.
# However we are going to have the same subdirectories with other OS eventually.
if("${TARGET_OS}" STREQUAL "android")
--- /dev/null
+function(list_subdirectories OUTPUT_VARIABLE)
+ cmake_parse_arguments(ARG "" "" "EXCLUDES" ${ARGN})
+
+ file(GLOB PROJECT_FILES
+ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
+ "*/CMakeLists.txt")
+
+ foreach(PROJECT_FILE IN ITEMS ${PROJECT_FILES})
+ get_filename_component(PROJECT_DIR ${PROJECT_FILE} DIRECTORY)
+ list(FIND ARG_EXCLUDES ${PROJECT_DIR} PROJECT_INDEX)
+ if(${PROJECT_INDEX} EQUAL -1)
+ list(APPEND PROJECT_LIST ${PROJECT_DIR})
+ endif(${PROJECT_INDEX} EQUAL -1)
+ endforeach(PROJECT_FILE)
+
+ set(${OUTPUT_VARIABLE} ${PROJECT_LIST} PARENT_SCOPE)
+endfunction(list_subdirectories)
+
+function(add_subdirectories)
+ cmake_parse_arguments(ARG "" "" "EXCLUDES" ${ARGN})
+
+ list_subdirectories(PROJECT_DIRS EXCLUDES ${ARG_EXCLUDES})
+
+ foreach(PROJECT_DIR IN ITEMS ${PROJECT_DIRS})
+ add_subdirectory(${PROJECT_DIR})
+ endforeach(PROJECT_DIR)
+endfunction(add_subdirectories)
-add_subdirectory(util)
-add_subdirectory(support)
-add_subdirectory(ARMComputeEx)
-add_subdirectory(cpp14)
-add_subdirectory(nnapi)
+# Add all subdirectories.
+# Each library in sub-directory must have it's own CMakeLists.txt
+# to build library's binaries or to support interface.
+add_subdirectories()