endif()
endfunction()
+function(ie_arm_neon_optimization_flags flags)
+ if(WIN32 OR CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
+ message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")
+ elseif(ANDROID)
+ if(ANDROID_ABI STREQUAL "arm64-v8a")
+ set(${flags} "-mfpu=neon" PARENT_SCOPE)
+ elseif(ANDROID_ABI STREQUAL "armeabi-v7a-hard with NEON")
+ set(${flags} "-march=armv7-a -mfloat-abi=hard -mhard-float -D_NDK_MATH_NO_SOFTFP=1 -mfpu=neon" PARENT_SCOPE)
+ elseif((ANDROID_ABI STREQUAL "armeabi-v7a with NEON") OR
+ (ANDROID_ABI STREQUAL "armeabi-v7a" AND
+ DEFINED CMAKE_ANDROID_ARM_NEON AND CMAKE_ANDROID_ARM_NEON))
+ set(${flags} "-march=armv7-a -mfloat-abi=softfp -mfpu=neon" PARENT_SCOPE)
+ endif()
+ else()
+ if(AARCH64)
+ set(${flags} "-O2 -ftree-vectorize" PARENT_SCOPE)
+ elseif(ARM)
+ set(${flags} "-mfpu=neon" PARENT_SCOPE)
+ endif()
+ endif()
+endfunction()
+
#
# Enables Link Time Optimization compilation
#
# include developer package
include(developer_package_ie)
-# These options are shared with 3rdparty plugins
-# by means of developer package
+# These options are shared with 3rdparty plugins by means of developer package
include(check_features_ie)
# resolving dependencies for the project
endif()
#
-# Add plugins
+# Add extra modules
#
-function(register_extra_plugins)
- set(InferenceEngineDeveloperPackage_DIR "${CMAKE_CURRENT_BINARY_DIR}/build-plugins")
- set(iedevconfig_file "${InferenceEngineDeveloperPackage_DIR}/InferenceEngineDeveloperPackageConfig.cmake")
- file(REMOVE "${iedevconfig_file}")
+function(register_extra_modules)
+ set(InferenceEngineDeveloperPackage_DIR "${CMAKE_CURRENT_BINARY_DIR}/build-modules")
- file(WRITE "${iedevconfig_file}" "\# !! AUTOGENERATED: DON'T EDIT !!\n\n")
- file(APPEND "${iedevconfig_file}" "ie_deprecated_no_errors()\n")
+ function(generate_fake_dev_package)
+ set(iedevconfig_file "${InferenceEngineDeveloperPackage_DIR}/InferenceEngineDeveloperPackageConfig.cmake")
+ file(REMOVE "${iedevconfig_file}")
- foreach(target IN LISTS OpenVINODeveloperPackageTargets IEDeveloperPackageTargets)
- if(target)
- file(APPEND "${iedevconfig_file}" "add_library(IE::${target} ALIAS ${target})\n")
- endif()
- endforeach()
+ file(WRITE "${iedevconfig_file}" "\# !! AUTOGENERATED: DON'T EDIT !!\n\n")
+ file(APPEND "${iedevconfig_file}" "ie_deprecated_no_errors()\n")
+
+ foreach(target IN LISTS OpenVINODeveloperPackageTargets IEDeveloperPackageTargets)
+ if(target)
+ file(APPEND "${iedevconfig_file}" "add_library(IE::${target} ALIAS ${target})\n")
+ endif()
+ endforeach()
+ endfunction()
+
+ generate_fake_dev_package()
# automatically import plugins from the 'plugins' folder
- file(GLOB local_extra_plugins "plugins/*")
+ file(GLOB local_extra_modules "plugins/*")
if(NGRAPH_INTERPRETER_ENABLE)
- list(APPEND local_extra_plugins "${OpenVINO_MAIN_SOURCE_DIR}/docs/template_plugin")
+ list(APPEND local_extra_modules "${OpenVINO_MAIN_SOURCE_DIR}/docs/template_plugin")
endif()
- foreach(plugin_path IN LISTS IE_EXTRA_PLUGINS local_extra_plugins)
- get_filename_component(plugin_dir "${plugin_path}" NAME)
- message(STATUS "Register ${plugin_dir} to be built in build-plugins/${plugin_dir}")
- add_subdirectory("${plugin_path}" "build-plugins/${plugin_dir}")
+ # detect where IE_EXTRA_MODULES contains folders with CMakeLists.txt
+ # other folders are supposed to have sub-folders with CMakeLists.txt
+ foreach(module_path IN LISTS IE_EXTRA_MODULES)
+ if(EXISTS "${module_path}/CMakeLists.txt")
+ list(APPEND extra_modules "${module_path}")
+ elseif(module_path)
+ file(GLOB extra_modules ${extra_modules} "${module_path}/*")
+ endif()
+ endforeach()
+
+ # add each extra module
+ foreach(module_path IN LISTS extra_modules local_extra_modules)
+ if(module_path)
+ get_filename_component(module_name "${module_path}" NAME)
+ if(NOT DEFINED BUILD_${module_name})
+ set(BUILD_${module_name} ON CACHE BOOL "Build ${module_name} extra module" FORCE)
+ endif()
+ if(BUILD_${module_name})
+ message(STATUS "Register ${module_name} to be built in build-modules/${module_name}")
+ add_subdirectory("${module_path}" "build-modules/${module_name}")
+ endif()
+ endif()
endforeach()
endfunction()
-register_extra_plugins()
+register_extra_modules()
endif()
if(ARM OR AARCH64)
- set(neon_flags "")
- if(WIN32 OR CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
- message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")
- elseif(ANDROID)
- if(ANDROID_ABI STREQUAL "arm64-v8a")
- set(neon_flags "-mfpu=neon")
- elseif(ANDROID_ABI STREQUAL "armeabi-v7a-hard with NEON")
- set(neon_flags "-march=armv7-a -mfloat-abi=hard -mhard-float -D_NDK_MATH_NO_SOFTFP=1 -mfpu=neon")
- elseif((ANDROID_ABI STREQUAL "armeabi-v7a with NEON") OR
- (ANDROID_ABI STREQUAL "armeabi-v7a" AND
- DEFINED CMAKE_ANDROID_ARM_NEON AND CMAKE_ANDROID_ARM_NEON))
- set(neon_flags "-march=armv7-a -mfloat-abi=softfp -mfpu=neon")
- endif()
- else()
- if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
- set(neon_flags "-O2 -ftree-vectorize")
- elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "armv7-a")
- set(neon_flags "-mfpu=neon")
- endif()
- endif()
+ ie_arm_neon_optimization_flags(neon_flags)
if(neon_flags)
file(GLOB NEON_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/arm_neon/*.hpp)