cmake-plugin: 调整 linux-terminal 插件适配可扩展宏方案

This commit is contained in:
zinface 2023-04-25 21:56:16 +08:00
parent d93152316e
commit cbd8d0e97b
2 changed files with 28 additions and 5 deletions

View File

@ -7,6 +7,9 @@
# linux-terminal-plugin -> your plugin name
set(LOCAL_PLUGIN_NAME "linux-terminal-plugin")
set(LOCAL_PLUGIN_VERSION "0.1")
configure_file(${CMAKE_SOURCE_DIR}/cmake/modules/config.h.in plugin-config.h @ONLY)
# linux-terminal-plugin
# linux-terminal-plugin
@ -55,6 +58,11 @@ endif(TRUE)
# ----------------- linux-terminal-plugin ----------------- #
target_compile_definitions(${LOCAL_PLUGIN_NAME}
#
PRIVATE
NOTEPAD_PLUGIN_DECLARE_PLUGIN_CONFIG)
if(WIN32 AND NOTEPAD_BUILD_BY_SHARED)
# Windows QScintilla
target_compile_definitions(${LOCAL_PLUGIN_NAME}
@ -90,7 +98,8 @@ spark_add_external_git_cmake_project(lxqt-build-tool
""
""
""
GIT_SHALLOW TRUE)
GIT_SHALLOW TRUE
EXCLUDE_FROM_ALL TRUE)
# 2. QTerminal lxqt-build-tool
spark_add_external_git_cmake_project(qtermwidget_git
@ -99,7 +108,8 @@ spark_add_external_git_cmake_project(qtermwidget_git
"-DCMAKE_PREFIX_PATH=${lxqt-build-tool-install};-DCMAKE_INSTALL_PREFIX=\${prj_install}"
"--;-j12"
""
GIT_SHALLOW TRUE)
GIT_SHALLOW TRUE
EXCLUDE_FROM_ALL TRUE)
# -------------------------------------------------------------------------------
# 3.
@ -124,7 +134,7 @@ add_dependencies(qtermwidget_git lxqt-build-tool)
# 2. qtermwidget qtermwidget_git
add_dependencies(qtermwidget qtermwidget_git)
# 3. qtermwidget qtermwidget_git
# 3. linux-terminal-plugin qtermwidget
add_dependencies(${LOCAL_PLUGIN_NAME} qtermwidget qtermwidget_git lxqt-build-tool)
# 4. qtermwidget

View File

@ -5,7 +5,20 @@
#include <qsciscintilla.h>
#include "ndd_plugin_implement.h"
NOTEPAD_PLUGIN_METADATA_IDENTIFY_V1("Linux Terminal", "0.1", "author", u8"基于 LXQT QTerminal 的插件", "");
NOTEPAD_PLUGIN_METADATA_IDENTIFY_1 {
USE_IDENTIFY_VARIABLES
NOTEPAD_PLUGIN_METADATA("简易 Linux 集成终端", "0.1", "author", u8"基于 LXQT QTerminal 的插件", "");
NOTEPAD_PLUGIN_METADATA_IMPLEMENT_V1(NddPluginImplement, false);
return true;
}
NOTEPAD_PLUGIN_METADATA_IMPLEMENT_1 {
USE_IMPLEMENT_VARIABLES
auto imp = new NddPluginImplement(s_pNotepad, s_getCurEdit());
imp->setMenuActions(s_pProcData.m_rootMenu);
imp->setCurrentEditFunc(s_getCurEdit);
return 0;
}