From 1346c6ad6ac2013d2f642545a1218cc0500bca8f Mon Sep 17 00:00:00 2001 From: zinface Date: Fri, 12 Apr 2024 19:57:03 +0800 Subject: [PATCH] =?UTF-8?q?cmake-plugin:=20=E5=9C=A8=20hello-simple=20?= =?UTF-8?q?=E4=B8=AD=E8=B0=83=E6=95=B4=E2=80=9C=E5=85=B1=E4=BA=AB=E7=9A=84?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=96=87=E4=BB=B6=E2=80=9D=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugin/framework-plugins/hello-simple/hello.cpp | 2 +- .../hello-simple/template/plugintemplate.txt | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/plugin/framework-plugins/hello-simple/hello.cpp b/src/plugin/framework-plugins/hello-simple/hello.cpp index 84a8143..fbd59ab 100644 --- a/src/plugin/framework-plugins/hello-simple/hello.cpp +++ b/src/plugin/framework-plugins/hello-simple/hello.cpp @@ -214,7 +214,7 @@ void Hello::registerPluginActions(QMenu *rootMenu) QTextStream fcmakeout(&fcmake); fcmakeout.setCodec("utf-8"); fcmakeout.setGenerateByteOrderMark(true); // with Bom - fcmakeout << txt.split("\n").mid(29,29).join("\n").replace(existDir, "${CMAKE_CURRENT_LIST_DIR}"); + fcmakeout << txt.split("\n").mid(29,28).join("\n").replace(existDir, "${CMAKE_CURRENT_LIST_DIR}"); fcmakeout << txt.split("\n").mid(8,10).join("\n").replace(existDir, "${CMAKE_CURRENT_LIST_DIR}"); fcmake.close(); } diff --git a/src/plugin/framework-plugins/hello-simple/template/plugintemplate.txt b/src/plugin/framework-plugins/hello-simple/template/plugintemplate.txt index f40016a..130e65f 100644 --- a/src/plugin/framework-plugins/hello-simple/template/plugintemplate.txt +++ b/src/plugin/framework-plugins/hello-simple/template/plugintemplate.txt @@ -30,12 +30,11 @@ endif(framework-plugintemplate_ENABLE) # 提供给其它插件项目引用的共享资源(如果其它插件想通过框架构建引用的话) if(FRAMEWORK_WANT_INCLUDE) message("-- [PLUGIN EXPORT]: FRAMEWORK_WANT_INCLUDE?") - set(FRAMEWORK_INCLUDE_EXPORTS # 共享的引用目录 - ${CMAKE_CURRENT_LIST_DIR}/src + set(FRAMEWORK_INCLUDE_EXPORTS # 共享的引用目录 - 用于 include + # ${CMAKE_CURRENT_LIST_DIR}/src ) - set(FRAMEWORK_SOURCES_EXPORTS # 共享的资源文件 - # ${CMAKE_CURRENT_LIST_DIR}/src/config.h # 通用的 qDebug 配置定义 - # ${CMAKE_CURRENT_LIST_DIR}/src/utils/qrcutil.* # 简化读取 qrc 资源文件内容 + set(FRAMEWORK_SOURCES_EXPORTS # 共享的资源文件 - 用于 构建 + # ${CMAKE_CURRENT_LIST_DIR}/src/*.cpp ) set(FRAMEWORK_WITHGIT_EXPORTS # 共享的引用构建资源 # 1. 引用了公共存储库