cmake-plugin: 调整框架引用层构建的信息打印格式

This commit is contained in:
zinface 2024-03-22 08:43:21 +08:00
parent 93b66b1651
commit eca90aacbd
1 changed files with 12 additions and 6 deletions

View File

@ -104,8 +104,6 @@ endmacro(add_framework_plugin _target)
# add_framework_plugin_with_git <git_repo_url> [git_args...] # add_framework_plugin_with_git <git_repo_url> [git_args...]
# git # git
macro(add_framework_plugin_with_git GIT_REPO_URL) macro(add_framework_plugin_with_git GIT_REPO_URL)
# string(REGEX MATCHALL "(?<=:\/\/)[^\/]+\/([^\/]+)\/([^\/]+)(?=\/)" GIT_VAR "${GIT_REPO_URL}")
set(GIT_ARGS ${ARGN}) set(GIT_ARGS ${ARGN})
# 1. # 1.
@ -145,7 +143,8 @@ macro(add_framework_plugin_with_git GIT_REPO_URL)
# 6. plugin.cmake # 6. plugin.cmake
if(EXISTS ${CMAKE_BINARY_DIR}/${URL_USER}_${URL_REPO}_git/plugin.cmake) if(EXISTS ${CMAKE_BINARY_DIR}/${URL_USER}_${URL_REPO}_git/plugin.cmake)
message("-- [GIT_PLUGIN] Found new plugin with git: ${CMAKE_BINARY_DIR}/${URL_USER}_${URL_REPO}_git/plugin.cmake") message("-- [GIT_PLUGIN] Found new plugin with git: ")
message(" ${CMAKE_BINARY_DIR}/${URL_USER}_${URL_REPO}_git/plugin.cmake")
set(WITH_GIT ON) set(WITH_GIT ON)
include(${CMAKE_BINARY_DIR}/${URL_USER}_${URL_REPO}_git/plugin.cmake) include(${CMAKE_BINARY_DIR}/${URL_USER}_${URL_REPO}_git/plugin.cmake)
else() else()
@ -169,8 +168,10 @@ macro(framework_plugin_include _target _plug_cmake)
set(FRAMEWORK_SOURCES_EXPORTS) set(FRAMEWORK_SOURCES_EXPORTS)
include(${_plug_cmake}) include(${_plug_cmake})
spark_file_glob(_want_files ${FRAMEWORK_SOURCES_EXPORTS}) spark_file_glob(_want_files ${FRAMEWORK_SOURCES_EXPORTS})
message("-- [FRAMEWORK ANALYZE]: ${_target} Want Dirs: ${FRAMEWORK_INCLUDE_EXPORTS}") message("-- [FRAMEWORK ANALYZE]: ${_target} Want Dirs: ")
message("-- [FRAMEWORK ANALYZE]: ${_target} Want Files: ${_want_files}") message(" ${FRAMEWORK_INCLUDE_EXPORTS}")
message("-- [FRAMEWORK ANALYZE]: ${_target} Want Files: ")
message(" ${_want_files}")
target_include_directories(${_target} PUBLIC ${FRAMEWORK_INCLUDE_EXPORTS}) target_include_directories(${_target} PUBLIC ${FRAMEWORK_INCLUDE_EXPORTS})
target_sources(${_target} PUBLIC ${_want_files}) target_sources(${_target} PUBLIC ${_want_files})
set(FRAMEWORK_WANT_INCLUDE FALSE) set(FRAMEWORK_WANT_INCLUDE FALSE)
@ -215,10 +216,15 @@ macro(framework_plugin_include_with_git _target GIT_REPO_URL)
if(NOT EXISTS ${CMAKE_BINARY_DIR}/${URL_USER}_${URL_REPO}_git) if(NOT EXISTS ${CMAKE_BINARY_DIR}/${URL_USER}_${URL_REPO}_git)
execute_process(COMMAND git clone ${GIT_REPO_URL} ${URL_USER}_${URL_REPO}_git ${GIT_ARGS} execute_process(COMMAND git clone ${GIT_REPO_URL} ${URL_USER}_${URL_REPO}_git ${GIT_ARGS}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
# else()
# execute_process(COMMAND git pull
# WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${URL_USER}_${URL_REPO}_git)
endif(NOT EXISTS ${CMAKE_BINARY_DIR}/${URL_USER}_${URL_REPO}_git) endif(NOT EXISTS ${CMAKE_BINARY_DIR}/${URL_USER}_${URL_REPO}_git)
if(EXISTS ${CMAKE_BINARY_DIR}/${URL_USER}_${URL_REPO}_git/plugin.cmake) if(EXISTS ${CMAKE_BINARY_DIR}/${URL_USER}_${URL_REPO}_git/plugin.cmake)
message("-- [WANT_GIT_PLUGIN] Found new plugin with git: ${CMAKE_BINARY_DIR}/${URL_USER}_${URL_REPO}_git/plugin.cmake") # message("-- [WANT_GIT_PLUGIN] Found new plugin with git: ${CMAKE_BINARY_DIR}/${URL_USER}_${URL_REPO}_git/plugin.cmake")
message("-- [WANT_GIT_PLUGIN] Found new plugin with git: ")
message(" ${CMAKE_BINARY_DIR}/${URL_USER}_${URL_REPO}_git/plugin.cmake")
# set(WITH_GIT ON) # set(WITH_GIT ON)
framework_plugin_include(${_target} framework_plugin_include(${_target}
${CMAKE_BINARY_DIR}/${URL_USER}_${URL_REPO}_git/plugin.cmake) ${CMAKE_BINARY_DIR}/${URL_USER}_${URL_REPO}_git/plugin.cmake)