提交 abbe5557 编写于 作者: kl222's avatar kl222

Modify plugins

上级 2f335c96
...@@ -63,7 +63,7 @@ int main(int argc, char *argv[]) ...@@ -63,7 +63,7 @@ int main(int argc, char *argv[])
f.close(); f.close();
} }
app.addLibraryPath(RabbitCommon::CDir::Instance()->GetDirPlugs()); app.addLibraryPath(RabbitCommon::CDir::Instance()->GetDirPlugins());
MainWindow w; MainWindow w;
......
...@@ -128,9 +128,9 @@ if(ANDROID) ...@@ -128,9 +128,9 @@ if(ANDROID)
set(INSTALL_FACE_RECOGNIZER_PLUGS_DIR "libs/${CMAKE_ANDROID_ARCH_ABI}") set(INSTALL_FACE_RECOGNIZER_PLUGS_DIR "libs/${CMAKE_ANDROID_ARCH_ABI}")
else() else()
set(INSTALL_DATA_PREFIX data) set(INSTALL_DATA_PREFIX data)
set(INSTALL_FACE_RECOGNIZER_PLUGS_DIR plugs) set(INSTALL_FACE_RECOGNIZER_PLUGS_DIR plugins)
endif() endif()
set(FACE_RECOGNIZER_PLUGS_BINARY_DIR ${CMAKE_BINARY_DIR}/plugs) set(FACE_RECOGNIZER_PLUGS_BINARY_DIR ${CMAKE_BINARY_DIR}/plugins)
include(CMakePackageConfigHelpers) include(CMakePackageConfigHelpers)
include(GNUInstallDirs) include(GNUInstallDirs)
......
...@@ -106,7 +106,7 @@ if(BUILD_TYPE STREQUAL "debug") ...@@ -106,7 +106,7 @@ if(BUILD_TYPE STREQUAL "debug")
SET(RCC_FILES ${RCC_FILES} ../Resource/ResourceSql.qrc) SET(RCC_FILES ${RCC_FILES} ../Resource/ResourceSql.qrc)
endif() endif()
add_subdirectory(Plugs) add_subdirectory(Plugins)
add_library(${PROJECT_NAME} ${SOURCES_FILES} ${HEADER_FILES} ${RCC_FILES}) add_library(${PROJECT_NAME} ${SOURCES_FILES} ${HEADER_FILES} ${RCC_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES set_target_properties(${PROJECT_NAME} PROPERTIES
......
...@@ -21,15 +21,15 @@ CFactoryFace::CFactoryFace(QObject *parent): QObject(parent), ...@@ -21,15 +21,15 @@ CFactoryFace::CFactoryFace(QObject *parent): QObject(parent),
} }
} }
QString szPath = RabbitCommon::CDir::Instance()->GetDirPlugs(); QString szPath = RabbitCommon::CDir::Instance()->GetDirPlugins();
#if !defined (Q_OS_ANDROID) #if !defined (Q_OS_ANDROID)
szPath = szPath + QDir::separator() + "Face"; szPath = szPath + QDir::separator() + "Face";
#endif #endif
QStringList filters; QStringList filters;
#if defined (Q_OS_WINDOWS) #if defined (Q_OS_WINDOWS)
filters << "*PlugFace*.dll"; filters << "*PluginFace*.dll";
#else #else
filters << "*PlugFace*.so"; filters << "*PluginFace*.so";
#endif #endif
FindPlugins(szPath, filters); FindPlugins(szPath, filters);
......
...@@ -31,15 +31,15 @@ CImageTool::CImageTool(QObject *parent) : QObject(parent), m_pConverFormat(nullp ...@@ -31,15 +31,15 @@ CImageTool::CImageTool(QObject *parent) : QObject(parent), m_pConverFormat(nullp
break; break;
} }
QString szPath = RabbitCommon::CDir::Instance()->GetDirPlugs(); QString szPath = RabbitCommon::CDir::Instance()->GetDirPlugins();
#if !defined (Q_OS_ANDROID) #if !defined (Q_OS_ANDROID)
szPath = szPath + QDir::separator() + "ConverFormat"; szPath = szPath + QDir::separator() + "ConverFormat";
#endif #endif
QStringList filters; QStringList filters;
#if defined (Q_OS_WINDOWS) #if defined (Q_OS_WINDOWS)
filters << "*PlugConverFormat*.dll"; filters << "*PluginConverFormat*.dll";
#else #else
filters << "*PlugConverFormat*.so"; filters << "*PluginConverFormat*.so";
#endif #endif
FindPlugins(szPath, filters); FindPlugins(szPath, filters);
} }
......
...@@ -8,19 +8,19 @@ if(POLICY CMP0020) ...@@ -8,19 +8,19 @@ if(POLICY CMP0020)
cmake_policy(SET CMP0020 NEW) cmake_policy(SET CMP0020 NEW)
endif() endif()
project(FaceRecognizerPlugs) project(FaceRecognizerPlugins)
#SUBDIRLIST(listPlugs ${CMAKE_CURRENT_SOURCE_DIR}) #SUBDIRLIST(listPlugs ${CMAKE_CURRENT_SOURCE_DIR})
set(listPlugs LibFacedetection OpenCV ncnn Seeta FFmpge) set(listPlugs LibFacedetection OpenCV ncnn Seeta FFmpge)
foreach(sub ${listPlugs}) foreach(sub ${listPlugs})
add_subdirectory(${sub}) add_subdirectory(${sub})
if(TARGET Plug${sub}) if(TARGET Plugin${sub})
set(PLUG_LIBS ${PLUG_LIBS} Plug${sub}) set(PLUG_LIBS ${PLUG_LIBS} Plugin${sub})
SET(PLUG_CONTENT "${PLUG_CONTENT}\nQ_IMPORT_PLUGIN(CFace${sub})") SET(PLUG_CONTENT "${PLUG_CONTENT}\nQ_IMPORT_PLUGIN(CFace${sub})")
endif() endif()
endforeach() endforeach()
if(NOT BUILD_SHARED_LIBS) if(NOT BUILD_SHARED_LIBS)
set(PLUGS_SOURCES_FILE ${CMAKE_BINARY_DIR}/PlugsSource.cpp) set(PLUGS_SOURCES_FILE ${CMAKE_BINARY_DIR}/PluginsSource.cpp)
FILE(WRITE ${PLUGS_SOURCES_FILE} "#include <QtPlugin>\n") FILE(WRITE ${PLUGS_SOURCES_FILE} "#include <QtPlugin>\n")
FILE(APPEND ${PLUGS_SOURCES_FILE} "#include <QObject>\n") FILE(APPEND ${PLUGS_SOURCES_FILE} "#include <QObject>\n")
......
...@@ -25,7 +25,7 @@ elseif(WIN32) ...@@ -25,7 +25,7 @@ elseif(WIN32)
COMPONENT Runtime) COMPONENT Runtime)
endif() endif()
project(PlugConverFormatFFMpeg) project(PluginConverFormatFFMpeg)
set(SOURCES_FILES set(SOURCES_FILES
ConverFormatFFmpeg.cpp ConverFormatFFmpeg.cpp
......
...@@ -4,10 +4,10 @@ if(NOT USE_LIBFACEDETECTION) ...@@ -4,10 +4,10 @@ if(NOT USE_LIBFACEDETECTION)
return() return()
endif() endif()
project(PlugFaceLibFacedetection) project(PluginFaceLibFacedetection)
find_package(facedetection) find_package(facedetection)
message("== Plugs libfacedetection:${facedetection_FOUND}") message("== Plugins libfacedetection:${facedetection_FOUND}")
if(NOT facedetection_FOUND) if(NOT facedetection_FOUND)
return() return()
endif() endif()
......
...@@ -3,7 +3,7 @@ if(NOT USE_OPENCV) ...@@ -3,7 +3,7 @@ if(NOT USE_OPENCV)
return() return()
endif() endif()
PROJECT(PlugConverFormatOpenCV) PROJECT(PluginConverFormatOpenCV)
find_package(OpenCV) find_package(OpenCV)
message("== Plug OpenCV:${OpenCV_FOUND}") message("== Plug OpenCV:${OpenCV_FOUND}")
......
...@@ -4,9 +4,9 @@ if(NOT USE_SEETA) ...@@ -4,9 +4,9 @@ if(NOT USE_SEETA)
return() return()
endif() endif()
project(PlugFaceSeeta) project(PluginFaceSeeta)
find_package(SeetaFace) find_package(SeetaFace)
message("== Plugs SeetaFace:${SeetaFace_FOUND}") message("== Plugins SeetaFace:${SeetaFace_FOUND}")
if(NOT SeetaFace_FOUND) if(NOT SeetaFace_FOUND)
return() return()
endif() endif()
......
...@@ -4,7 +4,7 @@ if(NOT USE_TEST) ...@@ -4,7 +4,7 @@ if(NOT USE_TEST)
return() return()
endif() endif()
project(PlugTest) project(PluginTest)
set(SOURCES_FILES set(SOURCES_FILES
Test.cpp Test.cpp
......
...@@ -4,9 +4,9 @@ if(NOT USE_NCNN) ...@@ -4,9 +4,9 @@ if(NOT USE_NCNN)
return() return()
endif() endif()
project(PlugFaceNcnn) project(PluginFaceNcnn)
find_package(ncnn) find_package(ncnn)
message("== Plugs ncnn:${ncnn_FOUND}") message("== Plugins ncnn:${ncnn_FOUND}")
if(NOT ncnn_FOUND) if(NOT ncnn_FOUND)
return() return()
endif() endif()
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
+ [CConverFormat 接口类](../Src/ConverFormat.h) + [CConverFormat 接口类](../Src/ConverFormat.h)
+ 插件位置: + 插件位置:
- android: 应用程序目录下 - android: 应用程序目录下
- windows、linux: 应用程序安装目录/plugs/ConverFormat - windows、linux: 应用程序安装目录/plugins/ConverFormat
+ 插件命名:project(PlugConverXXXX) + 插件命名:project(PluginConverXXXX)
- 人脸识别 - 人脸识别
+ [CFace 接口类](../Src/Face.h) + [CFace 接口类](../Src/Face.h)
+ 插件位置: + 插件位置:
- android: 应用程序目录下 - android: 应用程序目录下
- windows、linux: 应用程序安装目录/plugs/Face - windows、linux: 应用程序安装目录/plugins/Face
+ 插件命名:project(PlugFaceXXXX) + 插件命名:project(PluginFaceXXXX)
插件加载详见: [Src/FactoryFace.cpp 中的 CFactoryFace::FindPlugins 函数](../Src/FactoryFace.cpp) 插件加载详见: [Src/FactoryFace.cpp 中的 CFactoryFace::FindPlugins 函数](../Src/FactoryFace.cpp)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册