cmake-plugin: 引用核心加入间接资源引用构建(实验性)

This commit is contained in:
zinface 2024-04-10 01:52:05 +08:00
parent 395336704a
commit 62ae5ab332
1 changed files with 8 additions and 2 deletions

View File

@ -15,8 +15,10 @@ macro(framework_plugin_include _target _plug_cmake)
if(EXISTS ${_plug_cmake})
message("-- [FRAMEWORK WANT]: ${_target}")
set(FRAMEWORK_WANT_INCLUDE TRUE)
set(FRAMEWORK_PLUGIN ${_target}) # 使
set(FRAMEWORK_INCLUDE_EXPORTS)
set(FRAMEWORK_SOURCES_EXPORTS)
set(FRAMEWORK_WITHGIT_EXPORTS) # 使
include(${_plug_cmake})
spark_file_glob(_want_files ${FRAMEWORK_SOURCES_EXPORTS})
message("-- [FRAMEWORK ANALYZE]: ${_target} Want Dirs: ")
@ -25,13 +27,17 @@ macro(framework_plugin_include _target _plug_cmake)
message(" ${_want_files}")
target_include_directories(${_target} PUBLIC ${FRAMEWORK_INCLUDE_EXPORTS})
target_sources(${_target} PUBLIC ${_want_files})
foreach(shared_export IN LISTS FRAMEWORK_WITHGIT_EXPORTS)
string(REPLACE "," ";" shared_export "${shared_export}")
framework_plugin_include_with_git(${_target} ${shared_export})
endforeach()
set(FRAMEWORK_WANT_INCLUDE FALSE)
endif(EXISTS ${_plug_cmake})
endmacro(framework_plugin_include _target _plug_cmake)
# framework_plugin_include_with_git <target> <git_repo_url> [git_args...]
# git plugin.cmake
macro(framework_plugin_include_with_git _target GIT_REPO_URL)
function(framework_plugin_include_with_git _target GIT_REPO_URL)
set(GIT_ARGS ${ARGN})
# 1.
@ -84,6 +90,6 @@ macro(framework_plugin_include_with_git _target GIT_REPO_URL)
return()
endif(EXISTS ${CMAKE_SOURCE_DIR}/3rd_plugins_cache/${URL_USER}_${URL_REPO}_git/plugin.cmake)
endmacro(framework_plugin_include_with_git _target GIT_REPO_URL)
endfunction(framework_plugin_include_with_git _target GIT_REPO_URL)
# add_framework_plugin_with_git(https://gitee.com/ndd-community/notepad--plugin.plantuml-preview --branch=cmake-plugins-dev)