mirror of https://gitee.com/cxasm/notepad--.git
cmake-plugin: 抽离 base-plugin-interface/interfaces
This commit is contained in:
parent
372378f5e4
commit
0d64dc621f
|
@ -5,6 +5,9 @@ option(USE_NOTEPAD_PLUGIN_BASE "构建 Notepad-- 内部的插件基础模板" OF
|
|||
|
||||
if(USE_NOTEPAD_PLUGIN)
|
||||
|
||||
# 可扩展插件接口
|
||||
include(interfaces/interfaces.cmake)
|
||||
|
||||
if(USE_NOTEPAD_PLUGIN_BASE)
|
||||
# 默认的测试插件
|
||||
add_subdirectory(test)
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
|
||||
Symbolically linked file from template-plugins/base-plugin-interface
|
||||
|
||||
NOTE: This file should not be changed.
|
|
@ -0,0 +1,36 @@
|
|||
# interfaces.cmake
|
||||
# 仅作为在上层进行引入的方案
|
||||
|
||||
# 构建可扩展插件能力的接口
|
||||
# 从 base-plugin-interface 中进行设计并构建为 plugin_interface
|
||||
|
||||
|
||||
if(TRUE)
|
||||
set(interfaces
|
||||
${CMAKE_CURRENT_LIST_DIR}/ndd-base
|
||||
${CMAKE_CURRENT_LIST_DIR}/ndd-menu
|
||||
${CMAKE_CURRENT_LIST_DIR}/ndd-dock
|
||||
)
|
||||
message("interfaces:" "${interfaces}")
|
||||
|
||||
spark_add_library_file_glob(plugin_interface STATIC
|
||||
interfaces/ndd-base/*.h interfaces/ndd-base/*.cpp
|
||||
interfaces/ndd-menu/*.h interfaces/ndd-menu/*.cpp
|
||||
interfaces/ndd-dock/*.h interfaces/ndd-dock/*.cpp
|
||||
)
|
||||
target_include_directories(plugin_interface
|
||||
PUBLIC
|
||||
${interfaces})
|
||||
# target_link_qt5(plugin_interface)
|
||||
if(USE_QT6)
|
||||
target_link_qt6(plugin_interface)
|
||||
else()
|
||||
target_link_qt5(plugin_interface)
|
||||
endif(USE_QT6)
|
||||
endif(TRUE)
|
||||
|
||||
# 使用 spark 风格链接的 plugin_interface
|
||||
macro(target_link_plugin_interface _target)
|
||||
target_link_libraries(${_target}
|
||||
plugin_interface)
|
||||
endmacro(target_link_plugin_interface _target)
|
|
@ -92,24 +92,32 @@ endif(UNIX)
|
|||
|
||||
# ----------------- base-plugin-interface 构建接口化插件支持相关 ----------------- #
|
||||
|
||||
macro(target_link_plugin_interface _target)
|
||||
# 构建可扩展插件能力的接口 ndd_plugin_interface (仅在此处使用)
|
||||
macro(target_link_ndd_plugin_interface _target)
|
||||
set(interfaces
|
||||
interfaces/ndd-base
|
||||
interfaces/ndd-menu
|
||||
interfaces/ndd-dock)
|
||||
interfaces/ndd-dock
|
||||
)
|
||||
|
||||
spark_add_library_file_glob(plugin_interface STATIC
|
||||
spark_add_library_file_glob(ndd_plugin_interface STATIC
|
||||
interfaces/ndd-base/*.h interfaces/ndd-base/*.cpp
|
||||
interfaces/ndd-menu/*.h interfaces/ndd-menu/*.cpp
|
||||
interfaces/ndd-dock/*.h interfaces/ndd-dock/*.cpp
|
||||
)
|
||||
target_include_directories(plugin_interface
|
||||
target_include_directories(ndd_plugin_interface
|
||||
PUBLIC
|
||||
${interfaces})
|
||||
target_link_qt5(plugin_interface)
|
||||
|
||||
target_link_libraries(${_target}
|
||||
plugin_interface)
|
||||
endmacro(target_link_plugin_interface _target)
|
||||
if(USE_QT6)
|
||||
target_link_qt6(ndd_plugin_interface)
|
||||
else()
|
||||
target_link_qt5(ndd_plugin_interface)
|
||||
endif(USE_QT6)
|
||||
|
||||
target_link_libraries(${_target}
|
||||
ndd_plugin_interface)
|
||||
endmacro(target_link_ndd_plugin_interface _target)
|
||||
|
||||
# 构建可扩展插件能力的接口 ndd_plugin_interface (仅在此处使用)
|
||||
target_link_ndd_plugin_interface(${LOCAL_PLUGIN_NAME})
|
||||
|
||||
target_link_plugin_interface(${LOCAL_PLUGIN_NAME})
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
../../interfaces/
|
Loading…
Reference in New Issue