mirror of https://gitee.com/cxasm/notepad--.git
cmake-plugin: 使用 spark_file_glob 提升 QtCreator 中的显示
spark_file_glob(LocalSources ./*.h ./*.cpp ./*.ui )
This commit is contained in:
parent
c9d84a4749
commit
a5a270944c
|
@ -174,8 +174,9 @@ macro(spark_add_library_realpaths)
|
|||
endmacro(spark_add_library_realpaths)
|
||||
|
||||
|
||||
# spark_aux_source_paths
|
||||
# spark_aux_source_paths <var> [paths]...
|
||||
# 将指定路径中的文件变成可用的AUX源文件列表
|
||||
# 并提供 <var>_PATHS 记录源文件列表来源
|
||||
macro(spark_aux_source_paths AUX_VAR)
|
||||
set(${AUX_VAR} "")
|
||||
set(${AUX_VAR}_PATHS ${ARGN})
|
||||
|
@ -187,8 +188,9 @@ macro(spark_aux_source_paths AUX_VAR)
|
|||
|
||||
endmacro(spark_aux_source_paths AUX_VAR)
|
||||
|
||||
# spark_file_glob
|
||||
#
|
||||
# spark_file_glob <var> [regexp]...
|
||||
# 使用用 file(GLOB) 的匹配规则,并一次可匹配多个规则
|
||||
# 并提供 <var>_PATHS 记录规则列表
|
||||
macro(spark_file_glob FGLOB_VAR)
|
||||
set(${FGLOB_VAR} "")
|
||||
set(${FGLOB_VAR}_PATHS ${ARGN})
|
||||
|
@ -206,9 +208,9 @@ macro(spark_file_glob FGLOB_VAR)
|
|||
endmacro(spark_file_glob FGLOB_VAR)
|
||||
|
||||
|
||||
# spark_add_source_paths
|
||||
# 将指定路径中的文件变成可用的源文件列表
|
||||
#
|
||||
# spark_add_source_paths <var> [paths]...
|
||||
# 扩展 spark_aux_source_paths 宏增加可查找 ui 文件
|
||||
# 并提供 <var>_PATHS 记录源文件列表来源
|
||||
macro(spark_add_source_paths SOURCE_VAR)
|
||||
set(${SOURCE_VAR} "")
|
||||
set(${SOURCE_VAR}_PATHS ${ARGN})
|
||||
|
@ -235,3 +237,19 @@ macro(spark_add_source_paths SOURCE_VAR)
|
|||
endforeach(ui_src IN LISTS UI_SRCS)
|
||||
endforeach(source_path IN LISTS ${SOURCE_VAR}_PATHS)
|
||||
endmacro(spark_add_source_paths SOURCE_VAR)
|
||||
|
||||
|
||||
# spark_add_library_file_glob <var> <STATIC|SHARED|regexp> [regexp]...
|
||||
# 基于 regexp 所描述的内容进行构建库
|
||||
# 这是一个比较简单的 macros 扩展宏
|
||||
macro(spark_add_library_file_glob _lib_name _lib_type)
|
||||
|
||||
if(${_lib_type} STREQUAL SHARED OR ${_lib_type} STREQUAL STATIC)
|
||||
spark_file_glob(${_lib_name}_SOURCES ${ARGN})
|
||||
spark_add_library(${_lib_name} ${_lib_type} ${${_lib_name}_SOURCES})
|
||||
else()
|
||||
spark_file_glob(${_lib_name}_SOURCES ${_lib_type} ${ARGN})
|
||||
spark_add_library(${_lib_name} ${${_lib_name}_SOURCES})
|
||||
endif(${_lib_type} STREQUAL SHARED OR ${_lib_type} STREQUAL STATIC)
|
||||
|
||||
endmacro(spark_add_library_file_glob _lib_name _lib_type)
|
||||
|
|
|
@ -15,8 +15,8 @@ set(LOCAL_PLUGIN_NAME "external-plugin")
|
|||
|
||||
if(TRUE)
|
||||
# 准备构建 external-plugin 主程序扩展
|
||||
spark_aux_source_paths(LocalSources
|
||||
.
|
||||
spark_file_glob(LocalSources
|
||||
./*.h ./*.cpp ./*.ui
|
||||
)
|
||||
spark_add_library(${LOCAL_PLUGIN_NAME} SHARED ${LocalSources})
|
||||
target_include_directories(${LOCAL_PLUGIN_NAME} PRIVATE
|
||||
|
@ -83,7 +83,8 @@ endif(UNIX)
|
|||
|
||||
|
||||
# ----------------- external-plugin 构建的外部项目依赖 ----------------- #
|
||||
add_library(external-plugin-base SHARED external-plugin/base.cpp)
|
||||
add_library(external-plugin-base SHARED
|
||||
external-plugin/base.cpp external-plugin/interface/external.h)
|
||||
|
||||
if(WIN32)
|
||||
target_compile_features(external-plugin-base PUBLIC cxx_std_20)
|
||||
|
|
|
@ -15,8 +15,8 @@ set(LOCAL_PLUGIN_NAME "helloworld-next")
|
|||
|
||||
if(TRUE)
|
||||
# 准备构建 helloworld-next 主程序扩展
|
||||
spark_aux_source_paths(LocalSources
|
||||
.
|
||||
spark_file_glob(LocalSources
|
||||
./*.h ./*.cpp ./*.ui
|
||||
)
|
||||
spark_add_library(${LOCAL_PLUGIN_NAME} SHARED ${LocalSources})
|
||||
target_include_directories(${LOCAL_PLUGIN_NAME} PRIVATE
|
||||
|
|
|
@ -15,8 +15,8 @@ set(LOCAL_PLUGIN_NAME "opencc-demo-plugin")
|
|||
|
||||
if(TRUE)
|
||||
# 准备构建 opencc-demo-plugin 主程序扩展
|
||||
spark_aux_source_paths(LocalSources
|
||||
.
|
||||
spark_file_glob(LocalSources
|
||||
./*.h ./*.cpp ./*.ui
|
||||
)
|
||||
spark_add_library(${LOCAL_PLUGIN_NAME} SHARED ${LocalSources})
|
||||
target_include_directories(${LOCAL_PLUGIN_NAME} PRIVATE
|
||||
|
|
|
@ -15,8 +15,8 @@ set(LOCAL_PLUGIN_NAME "base-plugin")
|
|||
|
||||
if(TRUE)
|
||||
# 准备构建 base-plugin 主程序扩展
|
||||
spark_aux_source_paths(LocalSources
|
||||
.
|
||||
spark_file_glob(LocalSources
|
||||
./*.h ./*.cpp ./*.ui
|
||||
)
|
||||
spark_add_library(${LOCAL_PLUGIN_NAME} SHARED ${LocalSources})
|
||||
target_include_directories(${LOCAL_PLUGIN_NAME} PRIVATE
|
||||
|
|
|
@ -15,8 +15,8 @@ set(LOCAL_PLUGIN_NAME "base-secondary-menu-plugin-v1")
|
|||
|
||||
if(TRUE)
|
||||
# 准备构建 base-secondary-menu-plugin-v1 主程序扩展
|
||||
spark_aux_source_paths(LocalSources
|
||||
.
|
||||
spark_file_glob(LocalSources
|
||||
./*.h ./*.cpp ./*.ui
|
||||
)
|
||||
spark_add_library(${LOCAL_PLUGIN_NAME} SHARED ${LocalSources})
|
||||
target_include_directories(${LOCAL_PLUGIN_NAME} PRIVATE
|
||||
|
|
|
@ -15,8 +15,8 @@ set(LOCAL_PLUGIN_NAME "base-secondary-menu-plugin")
|
|||
|
||||
if(TRUE)
|
||||
# 准备构建 base-secondary-menu-plugin 主程序扩展
|
||||
spark_aux_source_paths(LocalSources
|
||||
.
|
||||
spark_file_glob(LocalSources
|
||||
./*.h ./*.cpp ./*.ui
|
||||
)
|
||||
spark_add_library(${LOCAL_PLUGIN_NAME} SHARED ${LocalSources})
|
||||
target_include_directories(${LOCAL_PLUGIN_NAME} PRIVATE
|
||||
|
|
|
@ -15,8 +15,8 @@ set(LOCAL_PLUGIN_NAME "base-widget-plugin")
|
|||
|
||||
if(TRUE)
|
||||
# 准备构建 base-widget-plugin 主程序扩展
|
||||
spark_aux_source_paths(LocalSources
|
||||
.
|
||||
spark_file_glob(LocalSources
|
||||
./*.h ./*.cpp ./*.ui
|
||||
)
|
||||
spark_add_library(${LOCAL_PLUGIN_NAME} SHARED ${LocalSources})
|
||||
target_include_directories(${LOCAL_PLUGIN_NAME} PRIVATE
|
||||
|
|
|
@ -15,8 +15,8 @@ set(LOCAL_PLUGIN_NAME "base-widget-ui-plugin")
|
|||
|
||||
if(TRUE)
|
||||
# 准备构建 base-widget-ui-plugin 主程序扩展
|
||||
spark_aux_source_paths(LocalSources
|
||||
.
|
||||
spark_file_glob(LocalSources
|
||||
./*.h ./*.cpp ./*.ui
|
||||
)
|
||||
spark_add_library(${LOCAL_PLUGIN_NAME} SHARED ${LocalSources})
|
||||
target_include_directories(${LOCAL_PLUGIN_NAME} PRIVATE
|
||||
|
|
Loading…
Reference in New Issue