spark: 探索 spark with git 构建 - 移除部分项目内模块

This commit is contained in:
zinface 2024-05-09 17:12:53 +08:00
parent 1346c6ad6a
commit 0ba627d75b
21 changed files with 137 additions and 1665 deletions

View File

@ -1,22 +1,27 @@
cmake_minimum_required(VERSION 3.20)
include(cmake/SparkCMakeInfoBeforeConfig.cmake)
include(cmake/SparkWithGit.cmake)
spark_include(SparkCMakeInfoBeforeConfig.cmake)
project(Notepad-- VERSION 2.0.0)
include(cmake/SparkCMakeInfoAfterConfig.cmake)
spark_include(SparkCMakeInfoAfterConfig.cmake)
# -------------- Notepad -- ------------- #
option(USE_QT6 "使用 Qt6 进行编译本项目与随带所有内容" OFF)
include(cmake/SparkEnvConfig.cmake)
include(cmake/SparkMacrosConfig.cmake)
spark_include(cmake/SparkEnvConfig.cmake)
spark_include(cmake/SparkMacrosConfig.cmake)
if(USE_QT6)
include(cmake/SparkFindQt6Config.cmake)
else()
include(cmake/SparkFindQt5Config.cmake)
endif(USE_QT6)
include(cmake/SparkMacrosExtendConfig.cmake)
spark_include(SparkMacrosExtendConfig.cmake)
include(cmake/SparkCMakeDebugConfig.cmake)
#
set(SPARK_FRAMEWORK_STORE "${CMAKE_SOURCE_DIR}/3rd_plugins_cache")
spark_include(SparkFramework.cmake)
# ----------------- ----------------- #
# Windows UNICODE TCHAR

View File

@ -1,192 +0,0 @@
# SparkAppimageConfig.cmake
# 1. 使 icon SparkDesktopConfig.cmake desktop
# desktop spark-appimage.dekstop
# 使 add_appimage
# add_appimage_icon
# add_appimage_desktop
# add_appimage
# 2. add_appimage cmake LINUXDEPLOYQT
# APPIMAGETOOL
# Appimage
# target_linuxdeploy() linuxdeploy
# target_appimage() appimage
# 3. linuxdeploy linuxdeployqt -appimage
# Appimage 使
# spark-appimage.desktop default.desktop
# spark-appimage.png default.png
# 4. appimage appimagetool
# Appimage
# default.desktop default.png
# copy-desktop-appimage
# :
# LINUXDEPLOYQT linuxdeployqt
# APPIMAGETOOL appimagetool
option(USE_APPIMAGE_NEW_GLIBC "允许在打包过程中使用较新版本的 glibc 库" ON)
set(APPIMAGE_OUTPUT "${CMAKE_BINARY_DIR}/appimage")
set(APPIMAGE_OUTPUT_ICON "${APPIMAGE_OUTPUT}/default.png")
set(APPIMAGE_OUTPUT_DESTKOP "${APPIMAGE_OUTPUT}/default.desktop")
# 1. Appimage 使
function(add_appimage_icon _icon)
if(CMAKE_VERSION VERSION_LESS 3.21)
message("> cmake version is less than 3.21")
configure_file(${_icon} ${APPIMAGE_OUTPUT_ICON} COPYONLY)
else()
file(MAKE_DIRECTORY ${APPIMAGE_OUTPUT})
file(COPY_FILE ${_icon} ${APPIMAGE_OUTPUT_ICON})
endif(CMAKE_VERSION VERSION_LESS 3.21)
endfunction(add_appimage_icon _icon)
# 2. SparkDesktopMacros.cmake desktop
# 使 desktop.in
function(add_appimage_desktop)
configure_file(cmake/spark-appimage.desktop.in.txt
${APPIMAGE_OUTPUT_DESTKOP} @ONLY)
endfunction(add_appimage_desktop)
function(target_linuxdeploy _target)
if(USE_APPIMAGE_NEW_GLIBC)
message("Use New glibc")
add_custom_target(linuxdeploy pwd
BYPRODUCTS appimage
COMMAND "${LINUXDEPLOYQT}" $<TARGET_FILE:${_target}> -appimage -unsupported-allow-new-glibc -verbose=3 -no-strip || true
WORKING_DIRECTORY "${APPIMAGE_OUTPUT}")
else()
message("Un Use New glibc")
add_custom_target(linuxdeploy pwd
BYPRODUCTS appimage
COMMAND "${LINUXDEPLOYQT}" $<TARGET_FILE:${_target}> -appimage -verbose=3 -no-strip || true
WORKING_DIRECTORY "${APPIMAGE_OUTPUT}")
endif(USE_APPIMAGE_NEW_GLIBC)
endfunction(target_linuxdeploy _target)
function(target_appimage)
add_custom_target(appimage pwd
COMMAND ${APPIMAGETOOL} ${APPIMAGE_OUTPUT}
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")
endfunction(target_appimage)
# 3. Appimage Appimage
function(add_appimage_target _target)
# check linuxdeploy
if(NOT DEFINED LINUXDEPLOYQT)
message("AppImage> Not Found LINUXDEPLOYQT Variable!")
return()
endif(NOT DEFINED LINUXDEPLOYQT)
if(CMAKE_VERSION VERSION_LESS 3.19)
message("> cmake version is less than 3.19")
if(CMAKE_VERSION VERSION_GREATER 3.4)
get_filename_component(LINUXDEPLOYQT_REAL_PATH ${LINUXDEPLOYQT} REALPATH)
else()
message("> cmake version is less than 3.4")
message(WARNING "!Relative paths are not supported!")
endif(CMAKE_VERSION VERSION_GREATER 3.4)
else()
file(REAL_PATH ${LINUXDEPLOYQT} LINUXDEPLOYQT_REAL_PATH)
endif(CMAKE_VERSION VERSION_LESS 3.19)
message("AppImage> Found LINUXDEPLOYQT Variable: ${LINUXDEPLOYQT_REAL_PATH}")
# check appimagetool
if(NOT DEFINED APPIMAGETOOL)
message("AppImage> Not Found APPIMAGETOOL Variable!")
return()
endif(NOT DEFINED APPIMAGETOOL)
if(CMAKE_VERSION VERSION_LESS 3.19)
# execute_process(COMMAND realpath ${APPIMAGETOOL} OUTPUT_VARIABLE APPIMAGETOOL_REAL_PATH)
message("> cmake version is less than 3.19")
if(CMAKE_VERSION VERSION_GREATER 3.4)
get_filename_component(APPIMAGETOOL_REAL_PATH ${APPIMAGETOOL} REALPATH)
else()
message("> cmake version is less than 3.4")
message(WARNING "!Relative paths are not supported!")
endif(CMAKE_VERSION VERSION_GREATER 3.4)
else()
file(REAL_PATH ${APPIMAGETOOL} APPIMAGETOOL_REAL_PATH)
endif(CMAKE_VERSION VERSION_LESS 3.19)
message("AppImage> Found APPIMAGETOOL Variable: ${APPIMAGETOOL}")
# do add_custome_target
make_directory(${APPIMAGE_OUTPUT})
target_linuxdeploy(${_target})
target_appimage()
#
set_target_properties(${_target}
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${APPIMAGE_OUTPUT}")
# 使 -unsupported-allow-new-glibc
# AppRun
if(NOT USE_APPIMAGE_NEW_GLIBC)
set_target_properties(${_target}
PROPERTIES
RUNTIME_OUTPUT_NAME "AppRun")
endif(NOT USE_APPIMAGE_NEW_GLIBC)
endfunction(add_appimage_target _target)
# glic>=2.27, -unsupported-allow-new-glibc 使
# -unsupported-bundle-everything
#
# -unsupported-bundle-everything
# ld-linux.so glibc
#
# 使
# -unsupported-allow-new-glibc
# linuxdeployqt Ubuntu LTS
# AppImage
# linuxdeployqt 使
# ./linuxdeployqt-7-x86_64.AppImage
# / -appimage -unsupported-allow-new-glibc
# ./linuxdeployqt-7-x86_64.AppImage
# / -appimage -unsupported-bundle-everything
# 1. Appimage
# include(cmake/SparkAppimageConfig.cmake) # Spark Appimage
# add_appimage_icon(assets/spark.png) # Appimage
# add_appimage_desktop() # Appimage 中的默认desktop(使用来自 Spark 构建的 Desktop 构建中配置的信息(必须要求 spark-desktop))
# add_appimage_target(${PROJECT_NAME}) # Appimage Appimage
# 2. Makefile Appimage --
# Makefile Appimage (要求提供工具的绝对路径然后可依次进行linuxdeployqt, genrate-appimage)
# https://github.com/probonopd/linuxdeployqt linuxdeployqt
# https://github.com/AppImage/AppImageKit appimagetool
# https://gitlink.org.cn/zinface/bundle-linuxdeployqt.git
#
# BUNDLE_LINUXDEPLOYQT := $(shell pwd)/build/bundle-linuxdeployqt
# download-bundle-linuxdeploytools:
# -git clone https://gitlink.org.cn/zinface/bundle-linuxdeployqt.git $(BUNDLE_LINUXDEPLOYQT)
# LINUXDEPLOYQT := "$(BUNDLE_LINUXDEPLOYQT)/linuxdeployqt-continuous-x86_64.AppImage"
# APPIMAGETOOL := "$(BUNDLE_LINUXDEPLOYQT)/appimagetool-x86_64.AppImage"
# linuxdeploy: release download-bundle-linuxdeploytools
# cd build && cmake .. -DLINUXDEPLOYQT=$(LINUXDEPLOYQT) -DAPPIMAGETOOL=$(APPIMAGETOOL)
# cd build && make linuxdeploy
# genrate-appimage:
# cd build && cmake .. -DLINUXDEPLOYQT=$(LINUXDEPLOYQT) -DAPPIMAGETOOL=$(APPIMAGETOOL)
# cd build && make appimage
# NOTE:
# 使 export LD_LIBRARY_PATH=<> 便 linuxdeployqt

View File

@ -1,8 +0,0 @@
cmake_minimum_required(VERSION 3.5.1)
# : make builddeps
add_custom_target(builddeps
COMMAND "${CMAKE_COMMAND}" "--graphviz=graphviz/builddeps.dot" .
COMMAND dot -Tpng graphviz/builddeps.dot -o builddeps.png
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
)

View File

@ -1,266 +0,0 @@
message( STATUS "After project command: CMAKE_C_COMPILER_ID = ${CMAKE_C_COMPILER_ID}" )
message( STATUS "After project command: CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}" )
message( STATUS "After project command: CMAKE_C_COMPILER = ${CMAKE_C_COMPILER}" )
message( STATUS "After project command: CMAKE_CXX_COMPILER = ${CMAKE_CXX_COMPILER}" )
message( STATUS "After project command: CMAKE_CXX_COMPILER_VERSION = ${CMAKE_CXX_COMPILER_VERSION}" )
message( STATUS "CMAKE_ROOT = ${CMAKE_ROOT}" )
message( STATUS "CMAKE_BINARY_DIR = ${CMAKE_BINARY_DIR}" )
message( STATUS "CMAKE_SOURCE_DIR = ${CMAKE_SOURCE_DIR}" )
message( STATUS "CMAKE_GENERATOR = ${CMAKE_GENERATOR}" )
message( STATUS "CMAKE_GENERATOR_PLATFORM = ${CMAKE_GENERATOR_PLATFORM}" )
message( STATUS "CMAKE_GENERATOR_TOOLSET = ${CMAKE_GENERATOR_TOOLSET}" )
message( STATUS "CMAKE_GENERATOR_INSTANCE = ${CMAKE_GENERATOR_INSTANCE}" )
message( STATUS "CMAKE_COMMAND = ${CMAKE_COMMAND}" )
message( STATUS "CMAKE_CPACK_COMMAND = ${CMAKE_CPACK_COMMAND}" )
message( STATUS "CMAKE_MAKE_PROGRAM = ${CMAKE_MAKE_PROGRAM}" )
message( STATUS "CMAKE_CACHE_MAJOR_VERSION = ${CMAKE_CACHE_MAJOR_VERSION}" )
message( STATUS "CMAKE_CACHE_MINOR_VERSION = ${CMAKE_CACHE_MINOR_VERSION}" )
message( STATUS "CMAKE_CACHE_PATCH_VERSION = ${CMAKE_CACHE_PATCH_VERSION}" )
message( STATUS "CMAKE_CACHEFILE_DIR = ${CMAKE_CACHEFILE_DIR}" )
message( STATUS "CMAKE_CROSSCOMPILING = ${CMAKE_CROSSCOMPILING}" )
message( STATUS "CMAKE_CROSSCOMPILING_EMULATOR = ${CMAKE_CROSSCOMPILING_EMULATOR}" )
message( STATUS "CMAKE_CTEST_COMMAND = ${CMAKE_CTEST_COMMAND}" )
message( STATUS "CMAKE_CURRENT_BINARY_DIR = ${CMAKE_CURRENT_BINARY_DIR}" )
message( STATUS "CMAKE_CURRENT_FUNCTION = ${CMAKE_CURRENT_FUNCTION}" )
message( STATUS "CMAKE_CURRENT_FUNCTION_LIST_DIR = ${CMAKE_CURRENT_FUNCTION_LIST_DIR}" )
message( STATUS "CMAKE_CURRENT_FUNCTION_LIST_LINE = ${CMAKE_CURRENT_FUNCTION_LIST_LINE}" )
message( STATUS "CMAKE_CURRENT_LIST_DIR = ${CMAKE_CURRENT_LIST_DIR}" )
message( STATUS "CMAKE_CURRENT_LIST_FILE = ${CMAKE_CURRENT_LIST_FILE}" )
message( STATUS "CMAKE_CURRENT_LIST_LINE = ${CMAKE_CURRENT_LIST_LINE}" )
message( STATUS "CMAKE_CURRENT_SOURCE_DIR = ${CMAKE_CURRENT_SOURCE_DIR}" )
message( STATUS "CMAKE_DEBUG_TARGET_PROPERTIES = ${CMAKE_DEBUG_TARGET_PROPERTIES}" )
message( STATUS "CMAKE_DIRECTORY_LABELS = ${CMAKE_DIRECTORY_LABELS}" )
message( STATUS "CMAKE_DL_LIBS = ${CMAKE_DL_LIBS}" )
message( STATUS "CMAKE_DOTNET_TARGET_FRAMEWORK = ${CMAKE_DOTNET_TARGET_FRAMEWORK}" )
message( STATUS "CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION = ${CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION}" )
message( STATUS "CMAKE_EDIT_COMMAND = ${CMAKE_EDIT_COMMAND}" )
message( STATUS "CMAKE_EXECUTABLE_SUFFIX = ${CMAKE_EXECUTABLE_SUFFIX}" )
message( STATUS "CMAKE_EXECUTABLE_SUFFIX_CXX = ${CMAKE_EXECUTABLE_SUFFIX_CXX}" )
message( STATUS "CMAKE_EXTRA_GENERATOR = ${CMAKE_EXTRA_GENERATOR}" )
message( STATUS "CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES = ${CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES}" )
message( STATUS "CMAKE_FIND_DEBUG_MODE = ${CMAKE_FIND_DEBUG_MODE}" )
message( STATUS "CMAKE_FIND_PACKAGE_NAME = ${CMAKE_FIND_PACKAGE_NAME}" )
message( STATUS "CMAKE_FIND_PACKAGE_SORT_DIRECTION = ${CMAKE_FIND_PACKAGE_SORT_DIRECTION}" )
message( STATUS "CMAKE_FIND_PACKAGE_SORT_ORDER = ${CMAKE_FIND_PACKAGE_SORT_ORDER}" )
message( STATUS "CMAKE_IMPORT_LIBRARY_PREFIX = ${CMAKE_IMPORT_LIBRARY_PREFIX}" )
message( STATUS "CMAKE_IMPORT_LIBRARY_SUFFIX = ${CMAKE_IMPORT_LIBRARY_SUFFIX}" )
message( STATUS "CMAKE_JOB_POOL_COMPILE = ${CMAKE_JOB_POOL_COMPILE}" )
message( STATUS "CMAKE_JOB_POOL_LINK = ${CMAKE_JOB_POOL_LINK}" )
message( STATUS "CMAKE_JOB_POOL_PRECOMPILE_HEADER = ${CMAKE_JOB_POOL_PRECOMPILE_HEADER}" )
message( STATUS "CMAKE_JOB_POOLS = ${CMAKE_JOB_POOLS}" )
message( STATUS "CMAKE_CXX_COMPILER_AR = ${CMAKE_CXX_COMPILER_AR}" )
message( STATUS "CMAKE_C_COMPILER_AR = ${CMAKE_C_COMPILER_AR}" )
message( STATUS "CMAKE_CXX_COMPILER_FRONTEND_VARIANT = ${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" )
message( STATUS "CMAKE_CXX_COMPILER_RANLIB = ${CMAKE_CXX_COMPILER_RANLIB}" )
message( STATUS "CMAKE_CXX_LINK_LIBRARY_SUFFIX = ${CMAKE_CXX_LINK_LIBRARY_SUFFIX}" )
message( STATUS "CMAKE_LINK_LIBRARY_SUFFIX = ${CMAKE_LINK_LIBRARY_SUFFIX}" )
message( STATUS "CMAKE_LINK_SEARCH_END_STATIC = ${CMAKE_LINK_SEARCH_END_STATIC}" )
message( STATUS "CMAKE_LINK_SEARCH_START_STATIC = ${CMAKE_LINK_SEARCH_START_STATIC}" )
message( STATUS "CMAKE_MAJOR_VERSION = ${CMAKE_MAJOR_VERSION}" )
message( STATUS "CMAKE_MINOR_VERSION = ${CMAKE_MINOR_VERSION}" )
message( STATUS "CMAKE_MINIMUM_REQUIRED_VERSION = ${CMAKE_MINIMUM_REQUIRED_VERSION}" )
message( STATUS "CMAKE_MAKE_PROGRAM = ${CMAKE_MAKE_PROGRAM}" )
message( STATUS "CMAKE_NETRC = ${CMAKE_NETRC}" )
message( STATUS "CMAKE_NETRC_FILE = ${CMAKE_NETRC_FILE}" )
message( STATUS "CMAKE_PARENT_LIST_FILE = ${CMAKE_PARENT_LIST_FILE}" )
message( STATUS "CMAKE_PATCH_VERSION = ${CMAKE_PATCH_VERSION}" )
message( STATUS "CMAKE_PROJECT_DESCRIPTION = ${CMAKE_PROJECT_DESCRIPTION}" )
message( STATUS "CMAKE_PROJECT_HOMEPAGE_URL = ${CMAKE_PROJECT_HOMEPAGE_URL}" )
message( STATUS "CMAKE_PROJECT_NAME = ${CMAKE_PROJECT_NAME}" )
message( STATUS "CMAKE_PROJECT_VERSION = ${CMAKE_PROJECT_VERSION}" )
message( STATUS "CMAKE_PROJECT_VERSION_MAJOR = ${CMAKE_PROJECT_VERSION_MAJOR}" )
message( STATUS "CMAKE_PROJECT_VERSION_MINOR = ${CMAKE_PROJECT_VERSION_MINOR}" )
message( STATUS "CMAKE_PROJECT_VERSION_PATCH = ${CMAKE_PROJECT_VERSION_PATCH}" )
message( STATUS "CMAKE_PROJECT_VERSION_TWEAK = ${CMAKE_PROJECT_VERSION_TWEAK}" )
message( STATUS "CMAKE_RANLIB = ${CMAKE_RANLIB}" )
message( STATUS "CMAKE_ROOT = ${CMAKE_ROOT}" )
message( STATUS "CMAKE_RULE_MESSAGES = ${CMAKE_RULE_MESSAGES}" )
message( STATUS "CMAKE_SCRIPT_MODE_FILE = ${CMAKE_SCRIPT_MODE_FILE}" )
message( STATUS "CMAKE_SHARED_LIBRARY_PREFIX = ${CMAKE_SHARED_LIBRARY_PREFIX}" )
message( STATUS "CMAKE_SHARED_LIBRARY_SUFFIX = ${CMAKE_SHARED_LIBRARY_SUFFIX}" )
message( STATUS "CMAKE_SHARED_MODULE_PREFIX = ${CMAKE_SHARED_MODULE_PREFIX}" )
message( STATUS "CMAKE_SHARED_MODULE_SUFFIX = ${CMAKE_SHARED_MODULE_SUFFIX}" )
message( STATUS "CMAKE_TOOLCHAIN_FILE = ${CMAKE_TOOLCHAIN_FILE}" )
message( STATUS "CMAKE_TWEAK_VERSION = ${CMAKE_TWEAK_VERSION}" )
message( STATUS "CMAKE_VERBOSE_MAKEFILE = ${CMAKE_VERBOSE_MAKEFILE}" )
message( STATUS "CMAKE_VERSION = ${CMAKE_VERSION}" )
message( STATUS "CMAKE_VS_DEVENV_COMMAND = ${CMAKE_VS_DEVENV_COMMAND}" )
message( STATUS "CMAKE_VS_MSBUILD_COMMAND = ${CMAKE_VS_MSBUILD_COMMAND}" )
message( STATUS "CMAKE_VS_NsightTegra_VERSION = ${CMAKE_VS_NsightTegra_VERSION}" )
message( STATUS "CMAKE_VS_PLATFORM_NAME = ${CMAKE_VS_PLATFORM_NAME}" )
message( STATUS "CMAKE_VS_PLATFORM_NAME_DEFAULT = ${CMAKE_VS_PLATFORM_NAME_DEFAULT}" )
message( STATUS "CMAKE_VS_PLATFORM_TOOLSET = ${CMAKE_VS_PLATFORM_TOOLSET}" )
message( STATUS "CMAKE_VS_PLATFORM_TOOLSET_CUDA = ${CMAKE_VS_PLATFORM_TOOLSET_CUDA}" )
message( STATUS "CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR = ${CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR}" )
message( STATUS "CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE = ${CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE}" )
message( STATUS "CMAKE_VS_PLATFORM_TOOLSET_VERSION = ${CMAKE_VS_PLATFORM_TOOLSET_VERSION}" )
message( STATUS "CMAKE_VS_TARGET_FRAMEWORK_VERSION = ${CMAKE_VS_TARGET_FRAMEWORK_VERSION}" )
message( STATUS "CMAKE_VS_TARGET_FRAMEWORK_IDENTIFIER = ${CMAKE_VS_TARGET_FRAMEWORK_IDENTIFIER}" )
message( STATUS "CMAKE_VS_TARGET_FRAMEWORK_TARGETS_VERSION = ${CMAKE_VS_TARGET_FRAMEWORK_TARGETS_VERSION}" )
message( STATUS "CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION = ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}" )
message( STATUS "CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM = ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM}" )
message( STATUS "CMAKE_INCLUDE_CURRENT_DIR = ${CMAKE_INCLUDE_CURRENT_DIR}" )
message( STATUS "CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE = ${CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE}" )
message( STATUS "CMAKE_INSTALL_NAME_DIR = ${CMAKE_INSTALL_NAME_DIR}" )
message( STATUS "CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH = ${CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH}" )
message( STATUS "CMAKE_INSTALL_RPATH = ${CMAKE_INSTALL_RPATH}" )
message( STATUS "CMAKE_INSTALL_RPATH_USE_LINK_PATH = ${CMAKE_INSTALL_RPATH_USE_LINK_PATH}" )
message( STATUS "CMAKE_INTERPROCEDURAL_OPTIMIZATION = ${CMAKE_INTERPROCEDURAL_OPTIMIZATION}" )
message( STATUS "CMAKE_CXX_CLANG_TIDY = ${CMAKE_CXX_CLANG_TIDY}" )
message( STATUS "CMAKE_CXX_COMPILER_LAUNCHER = ${CMAKE_CXX_COMPILER_LAUNCHER}" )
message( STATUS "CMAKE_CXX_CPPCHECK = ${CMAKE_CXX_CPPCHECK}" )
message( STATUS "CMAKE_CXX_CPPLINT = ${CMAKE_CXX_CPPLINT}" )
message( STATUS "CMAKE_CXX_INCLUDE_WHAT_YOU_USE = ${CMAKE_CXX_INCLUDE_WHAT_YOU_USE}" )
message( STATUS "CMAKE_CXX_LINKER_LAUNCHER = ${CMAKE_CXX_LINKER_LAUNCHER}" )
message( STATUS "CMAKE_CXX_LINK_LIBRARY_FILE_FLAG = ${CMAKE_CXX_LINK_LIBRARY_FILE_FLAG}" )
message( STATUS "CMAKE_CXX_LINK_LIBRARY_FLAG = ${CMAKE_CXX_LINK_LIBRARY_FLAG}" )
message( STATUS "CMAKE_CXX_LINK_WHAT_YOU_USE_FLAG = ${CMAKE_CXX_LINK_WHAT_YOU_USE_FLAG}" )
message( STATUS "CMAKE_CXX_VISIBILITY_PRESET = ${CMAKE_CXX_VISIBILITY_PRESET}" )
message( STATUS "CMAKE_LIBRARY_OUTPUT_DIRECTORY = ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}" )
message( STATUS "CMAKE_LIBRARY_PATH_FLAG = ${CMAKE_LIBRARY_PATH_FLAG}" )
message( STATUS "CMAKE_LINK_DEF_FILE_FLAG = ${CMAKE_LINK_DEF_FILE_FLAG}" )
message( STATUS "CMAKE_LINK_DEPENDS_NO_SHARED = ${CMAKE_LINK_DEPENDS_NO_SHARED}" )
message( STATUS "CMAKE_LINK_INTERFACE_LIBRARIES = ${CMAKE_LINK_INTERFACE_LIBRARIES}" )
message( STATUS "CMAKE_LINK_LIBRARY_FILE_FLAG = ${CMAKE_LINK_LIBRARY_FILE_FLAG}" )
message( STATUS "CMAKE_LINK_LIBRARY_FLAG = ${CMAKE_LINK_LIBRARY_FLAG}" )
message( STATUS "CMAKE_LINK_WHAT_YOU_USE = ${CMAKE_LINK_WHAT_YOU_USE}" )
message( STATUS "CMAKE_LINK_WHAT_YOU_USE_CHECK = ${CMAKE_LINK_WHAT_YOU_USE_CHECK}" )
message( STATUS "CMAKE_MODULE_LINKER_FLAGS = ${CMAKE_MODULE_LINKER_FLAGS}" )
message( STATUS "CMAKE_MODULE_LINKER_FLAGS_INIT = ${CMAKE_MODULE_LINKER_FLAGS_INIT}" )
message( STATUS "CMAKE_MSVCIDE_RUN_PATH = ${CMAKE_MSVCIDE_RUN_PATH}" )
message( STATUS "CMAKE_MSVC_RUNTIME_LIBRARY = ${CMAKE_MSVC_RUNTIME_LIBRARY}" )
message( STATUS "CMAKE_NO_BUILTIN_CHRPATH = ${CMAKE_NO_BUILTIN_CHRPATH}" )
message( STATUS "CMAKE_NO_SYSTEM_FROM_IMPORTED = ${CMAKE_NO_SYSTEM_FROM_IMPORTED}" )
message( STATUS "CMAKE_OPTIMIZE_DEPENDENCIES = ${CMAKE_OPTIMIZE_DEPENDENCIES}" )
message( STATUS "CMAKE_NO_BUILTIN_CHRPATH = ${CMAKE_NO_BUILTIN_CHRPATH}" )
message( STATUS "CMAKE_PCH_WARN_INVALID = ${CMAKE_PCH_WARN_INVALID}" )
message( STATUS "CMAKE_PCH_INSTANTIATE_TEMPLATES = ${CMAKE_PCH_INSTANTIATE_TEMPLATES}" )
message( STATUS "CMAKE_PDB_OUTPUT_DIRECTORY = ${CMAKE_PDB_OUTPUT_DIRECTORY}" )
message( STATUS "CMAKE_POSITION_INDEPENDENT_CODE = ${CMAKE_POSITION_INDEPENDENT_CODE}" )
message( STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" )
message( STATUS "CMAKE_SHARED_LINKER_FLAGS = ${CMAKE_SHARED_LINKER_FLAGS}" )
message( STATUS "CMAKE_SHARED_LINKER_FLAGS_INIT = ${CMAKE_SHARED_LINKER_FLAGS_INIT}" )
message( STATUS "CMAKE_SKIP_BUILD_RPATH = ${CMAKE_SKIP_BUILD_RPATH}" )
message( STATUS "CMAKE_SKIP_INSTALL_RPATH = ${CMAKE_SKIP_INSTALL_RPATH}" )
message( STATUS "CMAKE_STATIC_LINKER_FLAGS = ${CMAKE_STATIC_LINKER_FLAGS}" )
message( STATUS "CMAKE_STATIC_LINKER_FLAGS_INIT = ${CMAKE_STATIC_LINKER_FLAGS_INIT}" )
message( STATUS "CMAKE_TRY_COMPILE_CONFIGURATION = ${CMAKE_TRY_COMPILE_CONFIGURATION}" )
message( STATUS "CMAKE_TRY_COMPILE_PLATFORM_VARIABLES = ${CMAKE_TRY_COMPILE_PLATFORM_VARIABLES}" )
message( STATUS "CMAKE_TRY_COMPILE_TARGET_TYPE = ${CMAKE_TRY_COMPILE_TARGET_TYPE}" )
message( STATUS "CMAKE_COMPILER_IS_GNUCC = ${CMAKE_COMPILER_IS_GNUCC}" )
message( STATUS "CMAKE_COMPILER_IS_GNUCXX = ${CMAKE_COMPILER_IS_GNUCXX}" )
message( STATUS "CMAKE_COMPILER_IS_GNUG77 = ${CMAKE_COMPILER_IS_GNUG77}" )
message( STATUS "CMAKE_CUDA_ARCHITECTURES = ${CMAKE_CUDA_ARCHITECTURES}" )
message( STATUS "CMAKE_CUDA_COMPILE_FEATURES = ${CMAKE_CUDA_COMPILE_FEATURES}" )
message( STATUS "CMAKE_CUDA_EXTENSIONS = ${CMAKE_CUDA_EXTENSIONS}" )
message( STATUS "CMAKE_CUDA_HOST_COMPILER = ${CMAKE_CUDA_HOST_COMPILER}" )
message( STATUS "CMAKE_CUDA_STANDARD = ${CMAKE_CUDA_STANDARD}" )
message( STATUS "CMAKE_CUDA_STANDARD_REQUIRED = ${CMAKE_CUDA_STANDARD_REQUIRED}" )
message( STATUS "CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES = ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}" )
message( STATUS "CMAKE_CXX_COMPILE_FEATURES = ${CMAKE_CXX_COMPILE_FEATURES}" )
message( STATUS "CMAKE_CXX_EXTENSIONS = ${CMAKE_CXX_EXTENSIONS}" )
message( STATUS "CMAKE_CXX_STANDARD = ${CMAKE_CXX_STANDARD}" )
message( STATUS "CMAKE_CXX_STANDARD_REQUIRED = ${CMAKE_CXX_STANDARD}" )
message( STATUS "CMAKE_C_COMPILE_FEATURES = ${CMAKE_C_COMPILE_FEATURES}" )
message( STATUS "CMAKE_C_EXTENSIONS = ${CMAKE_C_EXTENSIONS}" )
message( STATUS "CMAKE_C_STANDARD = ${CMAKE_C_STANDARD}" )
message( STATUS "CMAKE_C_STANDARD_REQUIRED = ${CMAKE_C_STANDARD_REQUIRED}" )
message( STATUS "CMAKE_HIP_ARCHITECTURES = ${CMAKE_HIP_ARCHITECTURES}" )
message( STATUS "CMAKE_HIP_STANDARD = ${CMAKE_HIP_STANDARD}" )
message( STATUS "CMAKE_HIP_STANDARD_REQUIRED = ${CMAKE_HIP_STANDARD_REQUIRED}" )
message( STATUS "CMAKE_CXX_ARCHIVE_APPEND = ${CMAKE_CXX_ARCHIVE_APPEND}" )
message( STATUS "CMAKE_CXX_ARCHIVE_CREATE = ${CMAKE_CXX_ARCHIVE_CREATE}" )
message( STATUS "CMAKE_CXX_ARCHIVE_FINISH = ${CMAKE_CXX_ARCHIVE_FINISH}" )
message( STATUS "CMAKE_CXX_BYTE_ORDER = ${CMAKE_CXX_BYTE_ORDER}" )
message( STATUS "CMAKE_CXX_COMPILER = ${CMAKE_CXX_COMPILER}" )
message( STATUS "CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN = ${CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN}" )
message( STATUS "CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}" )
message( STATUS "CMAKE_CXX_COMPILER_LOADED = ${CMAKE_CXX_COMPILER_LOADED}" )
message( STATUS "CMAKE_CXX_COMPILER_PREDEFINES_COMMAND = ${CMAKE_CXX_COMPILER_PREDEFINES_COMMAND}" )
message( STATUS "CMAKE_CXX_COMPILER_TARGET = ${CMAKE_CXX_COMPILER_TARGET}" )
message( STATUS "CMAKE_CXX_COMPILER_VERSION = ${CMAKE_CXX_COMPILER_VERSION}" )
message( STATUS "CMAKE_CXX_COMPILE_OBJECT = ${CMAKE_CXX_COMPILE_OBJECT}" )
message( STATUS "CMAKE_CXX_CREATE_SHARED_LIBRARY = ${CMAKE_CXX_CREATE_SHARED_LIBRARY}" )
message( STATUS "CMAKE_CXX_CREATE_SHARED_MODULE = ${CMAKE_CXX_CREATE_SHARED_MODULE}" )
message( STATUS "CMAKE_CXX_CREATE_STATIC_LIBRARY = ${CMAKE_CXX_CREATE_STATIC_LIBRARY}" )
message( STATUS "CMAKE_CXX_EXTENSIONS = ${CMAKE_CXX_EXTENSIONS}" )
message( STATUS "CMAKE_CXX_EXTENSIONS_DEFAULT = ${CMAKE_CXX_EXTENSIONS_DEFAULT}" )
message( STATUS "CMAKE_CXX_FLAGS = ${CMAKE_CXX_FLAGS}" )
message( STATUS "CMAKE_CXX_FLAGS_DEBUG = ${CMAKE_CXX_FLAGS_DEBUG}" )
message( STATUS "CMAKE_CXX_FLAGS_DEBUG_INIT = ${CMAKE_CXX_FLAGS_DEBUG_INIT}" )
message( STATUS "CMAKE_CXX_FLAGS_INIT = ${CMAKE_CXX_FLAGS_INIT}" )
message( STATUS "CMAKE_CXX_FLAGS_MINSIZEREL = ${CMAKE_CXX_FLAGS_MINSIZEREL}" )
message( STATUS "CMAKE_CXX_FLAGS_MINSIZEREL_INIT = ${CMAKE_CXX_FLAGS_MINSIZEREL_INIT}" )
message( STATUS "CMAKE_CXX_FLAGS_RELEASE = ${CMAKE_CXX_FLAGS_RELEASE}" )
message( STATUS "CMAKE_CXX_FLAGS_RELEASE_INIT = ${CMAKE_CXX_FLAGS_RELEASE_INIT}" )
message( STATUS "CMAKE_CXX_FLAGS_RELWITHDEBINFO = ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}" )
message( STATUS "CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT = ${CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT}" )
message( STATUS "CMAKE_CXX_IGNORE_EXTENSIONS = ${CMAKE_CXX_IGNORE_EXTENSIONS}" )
message( STATUS "CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES = ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}" )
message( STATUS "CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES = ${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES}" )
message( STATUS "CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES = ${CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES}" )
message( STATUS "CMAKE_CXX_IMPLICIT_LINK_LIBRARIES = ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES}" )
message( STATUS "CMAKE_CXX_LIBRARY_ARCHITECTURE = ${CMAKE_CXX_LIBRARY_ARCHITECTURE}" )
message( STATUS "CMAKE_CXX_LINK_EXECUTABLE = ${CMAKE_CXX_LINK_EXECUTABLE}" )
message( STATUS "CMAKE_CXX_LINKER_PREFERENCE = ${CMAKE_CXX_LINKER_PREFERENCE}" )
message( STATUS "CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES = ${CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES}" )
message( STATUS "CMAKE_CXX_LINKER_WRAPPER_FLAG = ${CMAKE_CXX_LINKER_WRAPPER_FLAG}" )
message( STATUS "CMAKE_CXX_LINKER_WRAPPER_FLAG_SEP = ${CMAKE_CXX_LINKER_WRAPPER_FLAG_SEP}" )
message( STATUS "CMAKE_CXX_OUTPUT_EXTENSION = ${CMAKE_CXX_OUTPUT_EXTENSION}" )
message( STATUS "CMAKE_CXX_SIMULATE_ID = ${CMAKE_CXX_SIMULATE_ID}" )
message( STATUS "CMAKE_CXX_SIMULATE_VERSION = ${CMAKE_CXX_SIMULATE_VERSION}" )
message( STATUS "CMAKE_CXX_SIZEOF_DATA_PTR = ${CMAKE_CXX_SIZEOF_DATA_PTR}" )
message( STATUS "CMAKE_CXX_SOURCE_FILE_EXTENSIONS = ${CMAKE_CXX_SOURCE_FILE_EXTENSIONS}" )
message( STATUS "CMAKE_CXX_STANDARD = ${CMAKE_CXX_STANDARD}" )
message( STATUS "CMAKE_CXX_STANDARD_DEFAULT = ${CMAKE_CXX_STANDARD_DEFAULT}" )
message( STATUS "CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES = ${CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES}" )
message( STATUS "CMAKE_CXX_STANDARD_LIBRARIES = ${CMAKE_CXX_STANDARD_LIBRARIES}" )
message( STATUS "CMAKE_CXX_STANDARD_REQUIRED = ${CMAKE_CXX_STANDARD_REQUIRED}" )
message( STATUS "CMAKE_OBJC_EXTENSIONS = ${CMAKE_OBJC_EXTENSIONS}" )
message( STATUS "CMAKE_OBJC_STANDARD = ${CMAKE_OBJC_STANDARD}" )
message( STATUS "CMAKE_OBJC_STANDARD_REQUIRED = ${CMAKE_OBJC_STANDARD_REQUIRED}" )
message( STATUS "CMAKE_OBJCXX_EXTENSIONS = ${CMAKE_OBJCXX_EXTENSIONS}" )
message( STATUS "CMAKE_OBJCXX_STANDARD = ${CMAKE_OBJCXX_STANDARD}" )
message( STATUS "CMAKE_OBJCXX_STANDARD_REQUIRED = ${CMAKE_OBJCXX_STANDARD_REQUIRED}" )
message( STATUS "CMAKE_HOST_SYSTEM_NAME = ${CMAKE_HOST_SYSTEM_NAME}" )
message( STATUS "CMAKE_HOST_SYSTEM_VERSION = ${CMAKE_HOST_SYSTEM_VERSION}" )
message( STATUS "CMAKE_HOST_SYSTEM = ${CMAKE_HOST_SYSTEM}" )
message( STATUS "CMAKE_HOST_SYSTEM_PROCESSOR = ${CMAKE_HOST_SYSTEM_PROCESSOR}" )
message( STATUS "CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}" )
message( STATUS "CMAKE_SYSTEM_VERSION = ${CMAKE_SYSTEM_VERSION}" )
message( STATUS "CMAKE_SYSTEM = ${CMAKE_SYSTEM}" )
message( STATUS "CMAKE_SYSTEM_PROCESSOR = ${CMAKE_SYSTEM_PROCESSOR}" )
message( STATUS "CMAKE_HOST_UNIX = ${CMAKE_HOST_UNIX}" )
message( STATUS "CMAKE_HOST_WIN32 = ${CMAKE_HOST_WIN32}" )
message( STATUS "CMAKE_LIBRARY_ARCHITECTURE = ${CMAKE_LIBRARY_ARCHITECTURE}" )
message( STATUS "MSVC_VERSION = ${MSVC_VERSION}" )
message( STATUS "BUILD_SHARED_LIBS = ${BUILD_SHARED_LIBS}" )
message( STATUS "CXX_EXTENSIONS = ${CXX_EXTENSIONS}" )
message( STATUS "CMAKE_CXX_EXTENSIONS = ${CMAKE_CXX_EXTENSIONS}" )
message( STATUS "CXX_STANDARD = ${CXX_STANDARD}" )
message( STATUS "CMAKE_CXX_STANDARD = ${CMAKE_CXX_STANDARD}" )
message( STATUS "CMAKE_TOOLCHAIN_FILE = ${CMAKE_TOOLCHAIN_FILE}" )
message( STATUS "CMAKE_C_COMPILER = ${CMAKE_C_COMPILER}" )
message( STATUS "CMAKE_CXX_COMPILER = ${CMAKE_CXX_COMPILER}" )
message(STATUS "CMAKE_GENERATOR_NO_COMPILER_ENV: ${CMAKE_GENERATOR_NO_COMPILER_ENV}")
message(STATUS "CMAKE_C_COMPILER_ID: ${CMAKE_C_COMPILER_ID}")
message(STATUS "CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}")

View File

@ -1,8 +0,0 @@
cmake_minimum_required(VERSION 3.15)
message( STATUS "Before project command: CMAKE_C_COMPILER_ID = ${CMAKE_C_COMPILER_ID}" )
message( STATUS "Before project command: CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}" )
message( STATUS "Before project command: CMAKE_C_COMPILER = ${CMAKE_C_COMPILER}" )
message( STATUS "Before project command: CMAKE_CXX_COMPILER = ${CMAKE_CXX_COMPILER}" )
message( STATUS "Before project command: CMAKE_CXX_COMPILER_VERSION = ${CMAKE_CXX_COMPILER_VERSION}" )

View File

@ -1,366 +0,0 @@
cmake_minimum_required(VERSION 3.0.0)
# function(add_deb_package PACKAGE_NAME PACKAGE_VERSION PACKAGE_MAINTAINER PACKAGE_EMAIL PACKAGE_SHORT_DESCRIPTION PACKAGE_LONG_DESCRIPTION)
# endfunction(add_deb_package PACKAGE_NAME PACKAGE_VERSION PACKAGE_MAINTAINER PACKAGE_EMAIL PACKAGE_SHORT_DESCRIPTION PACKAGE_LONG_DESCRIPTION)
# if(add_deb_package VALUE) set(Package ${VALUE} PARENT_SCOPE) endif(add_deb_package VALUE)
# if(add_deb_version VALUE) set(Version ${VALUE} PARENT_SCOPE) endif(add_deb_version VALUE)
# if(add_deb_maintainer VALUE) set(Maintainer ${VALUE} PARENT_SCOPE) endif(add_deb_maintainer VALUE)
# if(add_deb_email VALUE) set(Email ${VALUE} PARENT_SCOPE) endif(add_deb_email VALUE)
# if(add_deb_descrition VALUE) set(Descrition ${VALUE} PARENT_SCOPE) endif(add_deb_descrition VALUE)
# if(add_deb_detail VALUE) set(Detail ${VALUE} PARENT_SCOPE) endif(add_deb_detail VALUE)
# set(Package "")
# set(Version "")
# set(Architecture "")
# set(Maintainer "")
# set(Email "")
# set(Descrition "")
function(find_str _IN _SEP _OUT)
string(FIND "${_IN}" "${_SEP}" _TMP)
set(${_OUT} ${_TMP} PARENT_SCOPE)
endfunction(find_str _IN _SEP _OUT)
function(find_next _IN _OUT)
find_str("${_IN}" "\n" _TMP)
set(${_OUT} ${_TMP} PARENT_SCOPE)
endfunction(find_next _IN _OUT)
function(sub_next _IN _INDEX _OUT __OUT)
find_next(${_IN} _NEXTINDEX)
string(SUBSTRING "${_IN}" ${_INDEX} ${_NEXTINDEX} _TMP)
math(EXPR _NEXTINDEX ${_NEXTINDEX}+1)
string(SUBSTRING "${_IN}" ${_NEXTINDEX} -1 __TMP)
set(${_OUT} ${_TMP} PARENT_SCOPE)
set(${__OUT} ${__TMP} PARENT_SCOPE)
endfunction(sub_next _IN _INDEX _OUT)
function(trim_str _IN _OUT)
string(STRIP "${_IN}" _TMP)
set(${_OUT} ${_TMP} PARENT_SCOPE)
endfunction(trim_str _IN _OUT)
function(split_str _IN _SEP _OUT)
string(FIND "${_IN}" "${_SEP}" _TMP_INDEX)
if(NOT _TMP_INDEX EQUAL -1)
string(SUBSTRING "${_IN}" 0 ${_TMP_INDEX} _TMP)
math(EXPR _TMP_INDEX ${_TMP_INDEX}+1)
string(SUBSTRING "${_IN}" ${_TMP_INDEX} -1 __TMP)
set(${_OUT} "${_TMP};${__TMP}" PARENT_SCOPE)
else()
set(${_OUT} ${_IN} PARENT_SCOPE)
endif(NOT _TMP_INDEX EQUAL -1)
endfunction(split_str _IN _SEP _OUT)
function(split_str_p _IN _SEP _OUT __OUT)
split_str("${_IN}" "${_SEP}" _TMP)
list(GET _TMP 0 __TMP)
list(GET _TMP 1 ___TMP)
set(${_OUT} ${__TMP} PARENT_SCOPE)
set(${__OUT} ${___TMP} PARENT_SCOPE)
endfunction(split_str_p _IN _SEP _OUT __OUT)
function(split_str_n _IN _SEP _OUT _N)
if(_N GREATER 1)
set(_C ${_N})
set(_RET "")
set(_NEXT ${_IN})
while(NOT _C EQUAL 0)
split_str("${_NEXT}" "${_SEP}" _TMP)
list(LENGTH _TMP _TMP_LEN)
if(_TMP_LEN EQUAL 2)
list(GET _TMP 0 __TMP)
list(GET _TMP 1 _NEXT)
list(APPEND _RET ${__TMP})
else()
break()
endif(_TMP_LEN EQUAL 2)
math(EXPR _C "${_C}-1")
endwhile(NOT _C EQUAL 0)
list(APPEND _RET ${_NEXT})
set(${_OUT} ${_RET} PARENT_SCOPE)
else()
split_str("${_IN}" "${_SEP}" _TMP)
set(${_OUT} ${_TMP} PARENT_SCOPE)
endif(_N GREATER 1)
endfunction(split_str_n _IN _SEP _OUT _N)
function(set_package_vars _IN_KEY _IN_VAL)
# trim_str("${_IN_KEY}" _IN_KEY)
find_str("${_IN_KEY}" "Type" _Type)
if(_Type EQUAL "0")
string(TOUPPER "${_IN_VAL}" _IN_VAL_UPPER)
string(TOLOWER "${_IN_VAL}" _IN_VAL_LOWER)
set(CPACK_GENERATOR "${_IN_VAL_UPPER}" PARENT_SCOPE)
message("--> 软件包类型: ${_IN_VAL_LOWER}")
endif(_Type EQUAL "0")
find_str("${_IN_KEY}" "Package" _Package)
if(_Package EQUAL "0")
if(_IN_VAL STREQUAL "auto")
set(CPACK_DEBIAN_PACKAGE_NAME "${PROJECT_NAME}" PARENT_SCOPE)
else()
set(CPACK_DEBIAN_PACKAGE_NAME "${_IN_VAL}" PARENT_SCOPE)
endif(_IN_VAL STREQUAL "auto")
message("--> 软件包名: ${_IN_VAL}")
endif(_Package EQUAL "0")
find_str("${_IN_KEY}" "Version" _Version)
if(_Version EQUAL "0")
if(_IN_VAL STREQUAL "auto")
set(CPACK_DEBIAN_PACKAGE_VERSION "${PROJECT_VERSION}" PARENT_SCOPE)
else()
set(CPACK_DEBIAN_PACKAGE_VERSION "${_IN_VAL}" PARENT_SCOPE)
endif(_IN_VAL STREQUAL "auto")
message("--> 软件版本: ${_IN_VAL}")
endif(_Version EQUAL "0")
find_str("${_IN_KEY}" "CalVer" _CalVer)
if(_CalVer EQUAL "0")
set(CalVer "${_IN_VAL}" PARENT_SCOPE)
message("--> 日历化版本: ${_IN_VAL}")
endif(_CalVer EQUAL "0")
find_str("${_IN_KEY}" "OSD" _OSDVer)
if(_OSDVer EQUAL "0")
set(OSDVer "${_IN_VAL}" PARENT_SCOPE)
message("--> 声明发行版号: ${_IN_VAL}")
endif(_OSDVer EQUAL "0")
find_str("${_IN_KEY}" "Architecture" _Architecture)
if(_Architecture EQUAL "0")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "${_IN_VAL}" PARENT_SCOPE)
if(_IN_VAL STREQUAL "auto")
execute_process(
COMMAND dpkg --print-architecture
OUTPUT_VARIABLE _RETV
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "${_RETV}" PARENT_SCOPE)
endif(_IN_VAL STREQUAL "auto")
message("--> 软件架构: ${_IN_VAL}")
endif(_Architecture EQUAL "0")
find_str("${_IN_KEY}" "Priority" _Priority)
if(_Priority EQUAL "0")
set(CPACK_DEBIAN_PACKAGE_PRIORITY "${_IN_VAL}" PARENT_SCOPE)
message("--> 优先级: ${_IN_VAL}")
endif(_Priority EQUAL "0")
find_str("${_IN_KEY}" "Depends" _Depends)
if(_Depends EQUAL "0")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${_IN_VAL}" PARENT_SCOPE)
message("--> 软件依赖: ${_IN_VAL}")
endif(_Depends EQUAL "0")
find_str("${_IN_KEY}" "Maintainer" _Maintainer)
if(_Maintainer EQUAL "0")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${_IN_VAL}" PARENT_SCOPE)
message("--> 软件维护者: ${_IN_VAL}")
endif(_Maintainer EQUAL "0")
find_str("${_IN_KEY}" "Homepage" _Homepage)
if(_Homepage EQUAL "0")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "${_IN_VAL}" PARENT_SCOPE)
message("--> 软件主页: ${_IN_VAL}")
endif(_Homepage EQUAL "0")
find_str("${_IN_KEY}" "Recommends" _Recommends)
if(_Recommends EQUAL "0")
set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "${_IN_VAL}" PARENT_SCOPE)
message("--> 软件建议: ${_IN_VAL}")
endif(_Recommends EQUAL "0")
find_str("${_IN_KEY}" "Conflicts" _Conflicts)
if(_Conflicts EQUAL "0")
set(CPACK_DEBIAN_PACKAGE_CONFLICTS "${_IN_VAL}" PARENT_SCOPE)
message("--> 软件冲突: ${_IN_VAL}")
endif(_Conflicts EQUAL "0")
endfunction(set_package_vars _IN_KEY _IN_VAL)
# 定义一个自定义(add_package_descript)
#
function(add_package_descript IN_DES)
set(PACKAGE_DES_PATH "${IN_DES}")
if(EXISTS ${IN_DES})
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${IN_DES}")
set(PACKAGE_DES_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${IN_DES}")
else()
message(FATAL_ERROR "!! Not Found Path: ${PACKAGE_DES_PATH}")
return()
endif(EXISTS ${IN_DES})
file(READ ${PACKAGE_DES_PATH} DES_CONTENT)
trim_str("${DES_CONTENT}" DES_CONTENT)
################## ##################
sub_next(${DES_CONTENT} NEXT_INDEX DES_LINE DES_CONTENT)
set(PREV_DES "")
while(NOT DES_LINE STREQUAL "${PREV_DES}")
# #
find_str("${DES_LINE}" "#" _COMMENT)
if(_COMMENT EQUAL "0")
message("--> !!!!!!! ${DES_LINE}")
sub_next(${DES_CONTENT} NEXT_INDEX DES_LINE DES_CONTENT)
continue()
endif(_COMMENT EQUAL "0")
# Descrition
find_str("${DES_LINE}" "Descrition" _DESCRIPTION)
if(_DESCRIPTION EQUAL "0")
break()
endif(_DESCRIPTION EQUAL "0")
split_str_n("${DES_LINE}" ":" _TMP 1)
list(LENGTH _TMP _TMP_LEN)
if(_TMP_LEN EQUAL 2)
split_str_p("${DES_LINE}" ":" _TMP __TMP)
trim_str("${__TMP}" __TMP)
string(LENGTH "${__TMP}" __TMP_LENGTH)
if(NOT __TMP_LENGTH EQUAL "0")
set_package_vars("${_TMP}" "${__TMP}")
endif(NOT __TMP_LENGTH EQUAL "0")
endif(_TMP_LEN EQUAL 2)
# 可能是已经结尾了(将保持重复行)
set(PREV_DES "${DES_LINE}")
sub_next(${DES_CONTENT} NEXT_INDEX DES_LINE DES_CONTENT)
endwhile(NOT DES_LINE STREQUAL "${PREV_DES}")
# Descrition
find_str("${DES_LINE}" "Descrition" _DESCRIPTION)
if(_DESCRIPTION EQUAL "0")
split_str_p("${DES_LINE}" ":" _TMP __TMP)
trim_str("${__TMP}" __TMP)
set(Descrition ${__TMP})
set(PREV_DES_LINE "")
while(NOT PREV_DES_LINE STREQUAL DES_LINE)
if(NOT PREV_DES_LINE STREQUAL "")
if ("${CMAKE_VERSION}" VERSION_LESS "3.15")
set(Descrition "${Descrition}\n${DES_LINE}")
else()
string(STRIP "${DES_LINE}" STRIP_DES_LINE)
set(Descrition "${Descrition}\n${STRIP_DES_LINE}")
endif("${CMAKE_VERSION}" VERSION_LESS "3.15")
endif(NOT PREV_DES_LINE STREQUAL "")
set(PREV_DES_LINE "${DES_LINE}")
sub_next(${DES_CONTENT} NEXT_INDEX DES_LINE DES_CONTENT)
endwhile(NOT PREV_DES_LINE STREQUAL DES_LINE)
# set(Descrition "${Descrition}")
message("--> 软件说明: ${Descrition}")
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${Descrition})
endif(_DESCRIPTION EQUAL "0")
##################### deb #####################
# ARCHITECTURE
if(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64")
set(ARCHITECTURE "amd64")
elseif(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "aarch64")
set(ARCHITECTURE "arm64")
endif()
#################### Calendar Version ###################
if("${CalVer}" STREQUAL "true")
string(TIMESTAMP BUILD_TIME "%Y%m%d")
set(CPACK_DEBIAN_PACKAGE_VERSION "${CPACK_DEBIAN_PACKAGE_VERSION}-${BUILD_TIME}")
endif("${CalVer}" STREQUAL "true")
####################### OS Release ######################
if("${OSDVer}" STREQUAL "true")
exec_program(lsb_release ARGS -si
OUTPUT_VARIABLE _OSI
)
exec_program(lsb_release ARGS -sr
OUTPUT_VARIABLE _OSR
)
if(NOT "${_OSI}" STREQUAL "" AND NOT "${_OSR}" STREQUAL "")
set(PACKAGE_SUFFIX "${PACKAGE_SUFFIX}_${_OSI}${_OSR}")
endif(NOT "${_OSI}" STREQUAL "" AND NOT "${_OSR}" STREQUAL "")
endif("${OSDVer}" STREQUAL "true")
##################### deb file name #####################
set(_Package "${CPACK_DEBIAN_PACKAGE_NAME}")
set(_Version "${CPACK_DEBIAN_PACKAGE_VERSION}")
set(_Architecture "${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
set(_DebFileName
"${_Package}_${_Version}_${_Architecture}${PACKAGE_SUFFIX}.deb"
)
set(CPACK_DEBIAN_FILE_NAME ${_DebFileName})
# : spark-deb-package
if(NOT "${PACKAGE_SUFFIX}" STREQUAL "")
# eg: remove '_' of '_Debian'
string(SUBSTRING "${PACKAGE_SUFFIX}" 1 -1 DISTRIBUTION)
if ("${CMAKE_VERSION}" VERSION_LESS "3.15")
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${Descrition}\n .\n Build for ${DISTRIBUTION} through spark-deb-build.")
else()
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${Descrition} "\n.\nBuild for ${DISTRIBUTION} through spark-deb-build.")
endif("${CMAKE_VERSION}" VERSION_LESS "3.15")
endif(NOT "${PACKAGE_SUFFIX}" STREQUAL "")
# set(CPACK_DEBIAN_PACKAGE_NAME "${Package}")
# set(CPACK_DEBIAN_PACKAGE_VERSION "${Version}")
# set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "${Architecture}")
# set(CPACK_DEBIAN_PACKAGE_DEPENDS "${Depends}")
# set(CPACK_DEBIAN_PACKAGE_PRIORITY "${Priority}")
# set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${Maintainer}")
# set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${Descrition}")
# 使
# set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
# "${CMAKE_SOURCE_DIR}/config/DEBIAN/preinst"
# "${CMAKE_SOURCE_DIR}/config/DEBIAN/postinst"
# "${CMAKE_SOURCE_DIR}/config/DEBIAN/prerm"
# "${CMAKE_SOURCE_DIR}/config/DEBIAN/postrm"
# )
# ON便使 dpkg-shlibdeps
# set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
# set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON)
# set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY "=")
include(CPack)
endfunction(add_package_descript IN_DES)
# TODO:
# CPACK_GENERATOR
# CPACK_DEBIAN_FILE_NAME - n
# CPACK_DEBIAN_PACKAGE_NAME - y
# CPACK_DEBIAN_PACKAGE_VERSION - y
# CPACK_DEBIAN_PACKAGE_ARCHITECTURE - y(auto) -> dpkg --print-architecture
# CPACK_DEBIAN_PACKAGE_DEPENDS - y
# CPACK_DEBIAN_PACKAGE_PRIORITY - y
# CPACK_DEBIAN_PACKAGE_MAINTAINER - y
# CPACK_DEBIAN_PACKAGE_DESCRIPTION - y
# ARCHITECTURE
# if(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64")
# set(ARCHITECTURE "amd64")
# elseif(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "aarch64")
# set(ARCHITECTURE "arm64")
# endif()
# string(TIMESTAMP BUILD_TIME "%Y%m%d")

View File

@ -1,50 +0,0 @@
# SparkDesktopMacros.cmake
macro(spark_desktop_macros)
set(APP_NAME ${ARGV0})
set(APP_NAME_ZH_CN ${ARGV1})
set(APP_COMMENT ${ARGV2})
set(APP_TYPE ${ARGV3})
set(APP_EXECUTE_PATH ${ARGV4})
set(APP_EXECUTE_ICON_PATH ${ARGV5})
set(APP_CATEGORIES ${ARGV6})
set(APP_MIME_TYPE ${ARGV7})
configure_file(cmake/spark-desktop.desktop.in.txt
${CMAKE_BINARY_DIR}/${ARGV0}.desktop
)
set(SPARK_DESKTOP_FILE ${CMAKE_BINARY_DIR}/${ARGV0}.desktop)
endmacro(spark_desktop_macros)
# include(cmake/SparkDesktopMacros.cmake)
# : Name=
# spark_desktop_macros(
# : Name=
# : Name[zh_CN]=
# : Comment=
# : Type=
# : Exec=
# : Icon=
# : Categories=
# MIME: MimeType=
# )
# TODO INSTALL(将自动实现 install 文件,如 /usr/share/applications)
# install(FILES ${APP_NAME}.desktop
# DESTINATION /usr/share/applications
# )
#
# install(FILES ${SPARK_DESKTOP_FILE}
# DESTINATION /usr/share/applications
# )
# configure_file
# configure_file(<input> <output>
# [NO_SOURCE_PERMISSIONS | USE_SOURCE_PERMISSIONS |
# FILE_PERMISSIONS <permissions>...]
# [COPYONLY] [ESCAPE_QUOTES] [@ONLY]
# [NEWLINE_STYLE [UNIX|DOS|WIN32|LF|CRLF] ])
# install(FILES ${SPARK_DESKTOP_FILE}.desktop
# DESTINATION /usr/share/applications
# )

View File

@ -1,29 +0,0 @@
cmake_minimum_required(VERSION 3.5.1)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
# set(CMAKE_BUILD_TYPE "Debug")
option(SPARK_DEBUG_MESSAGE "CMake Spark Module Debug Message." OFF)
set(SPARK_DEBUG_LOGFILE "${CMAKE_BINARY_DIR}/spark_debug.log" CACHE STRING "Spark Build Debug logfile." FORCE)
file(WRITE ${SPARK_DEBUG_LOGFILE})
macro(spark_debug_message)
if(SPARK_DEBUG_MESSAGE)
set(SPARK_ONECE_LOG ${ARGN})
if(NOT "${SPARK_ONECE_LOG}" STREQUAL "")
message("[SPARK_MESSAGE]: " ${SPARK_ONECE_LOG})
endif(NOT "${SPARK_ONECE_LOG}" STREQUAL "")
file(APPEND ${SPARK_DEBUG_LOGFILE} ${SPARK_ONECE_LOG} "\n")
unset(SPARK_ONECE_LOG)
endif(SPARK_DEBUG_MESSAGE)
endmacro(spark_debug_message)
# Windows Debug(_d) Release(_r)
if(WIN32)
set(CMAKE_DEBUG_POSTFIX "_d")
set(CMAKE_RELEASE_POSTFIX "_r")
endif(WIN32)

View File

@ -1,88 +0,0 @@
# SparkExternalProject.cmake
#
# Linux
include(ExternalProject)
# spark_add_external_git_cmake_project
# git CMake
# 使 ExternalProject_Add
#
# prj - _git
# prj_git
# prj_cfg 使 "" )
# prj_bld 使 "" )
# prj_inl 使 "" )
# ARGN ExternalProject_Add
# 使
# ${prj}-source
# ${prj}-build
# ${prj}-install
#
# ""
# 使 "A;B;C"
# prj_cfg
# "-DCMAKE_BUILD_TYPE=Release"
# "-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=\${prj_install}"
# : \${prj_install} ${prj_install}
# prj_install
# ${prj_install}
# prj_bld
# "--config Release -- -j12"
# 使 ';' "--config;Release;--;-j12"
# 使 ';' cmake
# ARGN
# ExternalProject_Add
function(spark_add_external_git_cmake_project prj prj_git prj_cfg prj_bld prj_inl)
set(prefix "3rlib")
set(prj_source "3rlib/src/${prj}")
set(prj_build "3rlib/src/${prj}-build")
set(prj_install "3rlib/src/${prj}-install")
set(prj_source "${CMAKE_CURRENT_BINARY_DIR}/${prj_source}")
set(prj_build "${CMAKE_CURRENT_BINARY_DIR}/${prj_build}")
set(prj_install "${CMAKE_CURRENT_BINARY_DIR}/${prj_install}")
include(ExternalProject)
ExternalProject_Add(${prj}
PREFIX ${prefix}
GIT_REPOSITORY ${prj_git}
CONFIGURE_COMMAND ${CMAKE_COMMAND} -S ${prj_source} -B ${prj_build} ${prj_cfg}
BUILD_COMMAND ${CMAKE_COMMAND} --build ${prj_build} ${prj_bld}
INSTALL_COMMAND ${CMAKE_COMMAND} --install ${prj_build}
--prefix ${prj_install} ${prj_inl}
${ARGN}
)
set(${prj}-source "${prj_source}" PARENT_SCOPE)
set(${prj}-build "${prj_build}" PARENT_SCOPE)
set(${prj}-install "${prj_install}" PARENT_SCOPE)
endfunction(spark_add_external_git_cmake_project prj prj_git prj_cfg prj_bld prj_inl)
# spark_add_external_git_cmake_project(lxqt-build-tool
# https://www.gitlink.org.cn/zinface/lxqt-build-tools.git
# "" #
# "" #
# "" #
# GIT_SHALLOW TRUE)
# spark_add_external_git_cmake_project(qtermwidget_git
# https://www.gitlink.org.cn/zinface/qtermwidget.git
# #
# "-DCMAKE_PREFIX_PATH=${lxqt-build-tool-install};-DCMAKE_INSTALL_PREFIX=\${prj_install}"
# #
# "--;-j12"
# #
# ""
# GIT_SHALLOW TRUE)

View File

@ -1,11 +0,0 @@
cmake_minimum_required(VERSION 3.5.1)
# include(SparkFindQt5Config.cmake)
find_package(Dtk COMPONENTS Core Widget Gui)
function(target_link_dtk NAME)
target_link_libraries(${NAME}
${DtkCore_LIBRARIES}
${DtkWidget_LIBRARIES}
${DtkGui_LIBRARIES})
endfunction(target_link_dtk NAME)

View File

@ -1,7 +0,0 @@
cmake_minimum_required(VERSION 3.5.1)
# spark_find_library(notify libnotify)
# function(target_link_${_prefix} TARGET)
# target_link_libraries(${TARGET} ${_prefix})
# endfunction(target_link_${_prefix} TARGET)

View File

@ -1,6 +1,9 @@
cmake_minimum_required(VERSION 3.5.1)
set(SPARK_FIND_QT5 TRUE)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
find_package(Qt5 COMPONENTS Core Widgets Network REQUIRED)

View File

@ -1,6 +1,9 @@
cmake_minimum_required(VERSION 3.5.1)
set(SPARK_FIND_QT6 TRUE)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
find_package(Qt6 COMPONENTS Core Widgets Network REQUIRED)

View File

@ -1,439 +0,0 @@
# find_plus
# INVAl + OUTVAL
function(find_plus INVAL OUTVAL)
string(FIND "${INVAL}" "+" plus_index)
set(${OUTVAL} ${plus_index} PARENT_SCOPE)
endfunction(find_plus INVAL OUTVAL)
function(find_plus_v INVAL OUTVAL)
string(FIND "${${INVAL}}" "+" plus_index)
set(${OUTVAL} ${plus_index} PARENT_SCOPE)
endfunction(find_plus_v INVAL OUTVAL)
function(find_colon INVAL OUTVAL)
string(FIND "${INVAL}" ":" colon_index)
set(${OUTVAL} ${colon_index} PARENT_SCOPE)
endfunction(find_colon INVAL OUTVAL)
function(find_colon_v INVAL OUTVAL)
string(FIND "${${INVAL}}" ":" colon_index)
set(${OUTVAL} ${colon_index} PARENT_SCOPE)
endfunction(find_colon_v INVAL OUTVAL)
function(find_dir INVAL OUTVAL)
string(FIND "${INVAL}" "/" _STR ${ARGN})
set(${OUTVAL} ${_STR} PARENT_SCOPE)
endfunction(find_dir INVAL OUTVAL)
function(find_dir_v INVAL OUTVAL)
string(FIND "${${INVAL}}" "/" _STR ${ARGN})
set(${OUTVAL} ${_STR} PARENT_SCOPE)
endfunction(find_dir_v INVAL OUTVAL)
#
function(str_left INVAL INDEX OUTVAL)
set(LEFT_INDEX ${INDEX})
string(SUBSTRING "${INVAL}" 0 ${LEFT_INDEX} _LEFT_V)
set(${OUTVAL} ${_LEFT_V} PARENT_SCOPE)
endfunction(str_left INVAL INDEX OUTVAL)
function(str_right INVAL INDEX OUTVAL)
math(EXPR RIGHT_INDEX ${INDEX}+1)
string(SUBSTRING "${INVAL}" ${RIGHT_INDEX} -1 _RIGHT_V)
set(${OUTVAL} ${_RIGHT_V} PARENT_SCOPE)
endfunction(str_right INVAL INDEX OUTVAL)
function(str_left_v INVAL INDEX OUTVAL)
set(LEFT_INDEX ${${INDEX}})
string(SUBSTRING "${${INVAL}}" 0 ${LEFT_INDEX} _LEFT_V)
set(${OUTVAL} ${_LEFT_V} PARENT_SCOPE)
endfunction(str_left_v INVAL INDEX OUTVAL)
function(str_right_v INVAL INDEX OUTVAL)
math(EXPR RIGHT_INDEX ${${INDEX}}+1)
string(SUBSTRING "${${INVAL}}" ${RIGHT_INDEX} -1 _RIGHT_V)
set(${OUTVAL} ${_RIGHT_V} PARENT_SCOPE)
endfunction(str_right_v INVAL INDEX OUTVAL)
#
function(find_colon_plus INVAL OUTVAL)
find_colon(${INVAL} COLON_INDEX)
str_right(${INVAL} ${COLON_INDEX} COLON_RIGHT)
find_plus_v(COLON_RIGHT PLUS_INDEX)
str_left_v(COLON_RIGHT PLUS_INDEX COLON_RIGHT_LEFT_PLUS)
set(${OUTVAL} ${COLON_RIGHT_LEFT_PLUS} PARENT_SCOPE)
endfunction(find_colon_plus INVAL OUTVAL)
function(find_colon_plus_v INVAL OUTVAL)
find_colon_v(${INVAL} COLON_INDEX)
str_right_v(${INVAL} COLON_INDEX COLON_RIGHT)
find_plus_v(COLON_RIGHT PLUS_INDEX)
str_left_v(COLON_RIGHT PLUS_INDEX COLON_RIGHT_LEFT_PLUS)
set(${OUTVAL} ${COLON_RIGHT_LEFT_PLUS} PARENT_SCOPE)
endfunction(find_colon_plus_v INVAL OUTVAL)
function(find_dir_plus INVAL OUTVAL)
# t:*/*+d
# ^
find_dir("${INVAL}" SLASH_INDEX REVERSE)
str_right("${INVAL}" ${SLASH_INDEX} SLASH_RIGHT)
find_plus_v(SLASH_RIGHT PLUS_INDEX)
str_left_v(SLASH_RIGHT PLUS_INDEX SLASH_RIGHT_LEFT_PLUS)
set(${OUTVAL} ${SLASH_RIGHT_LEFT_PLUS} PARENT_SCOPE)
endfunction(find_dir_plus INVAL OUTVAL)
function(find_dir_plus_v INVAL OUTVAL)
# t:*/*+d
# ^
find_dir("${${INVAL}}" SLASH_INDEX REVERSE)
str_right("${${INVAL}}" ${SLASH_INDEX} SLASH_RIGHT)
find_plus_v(SLASH_RIGHT PLUS_INDEX)
str_left_v(SLASH_RIGHT PLUS_INDEX SLASH_RIGHT_LEFT_PLUS)
set(${OUTVAL} ${SLASH_RIGHT_LEFT_PLUS} PARENT_SCOPE)
endfunction(find_dir_plus_v INVAL OUTVAL)
# spark_add_library_source <target> ...
#
#
macro(spark_add_library_source target)
set(${target}_ADD_SOURCE ${ARGN})
endmacro(spark_add_library_source target)
# target_link_qt5 qt6
macro(_handle_spark_target_link_qt_macro _target)
target_link_qt(${_target})
endmacro(_handle_spark_target_link_qt_macro _target)
# spark_add_library_realpaths [dirs ...]
#
# :
# : +A+B
macro(spark_add_library_realpaths)
set(REALPATHS ${ARGN})
foreach(REALPATH IN LISTS REALPATHS)
# # : :
# find_colon(${REALPATH} COLON_INDEX)
# / /
find_dir_v(REALPATH SLASH_INDEX REVERSE)
# + +
find_plus_v(REALPATH PLUS_INDEX)
# +
if(PLUS_INDEX LESS 0)
# +
set(dir ${REALPATH})
str_right_v(REALPATH SLASH_INDEX target)
spark_add_library_path(${target}
${dir}
${${target}_ADD_SOURCE}
)
# 使 spark_add_library_realpaths
target_include_directories(${target} PUBLIC ${dir})
_handle_spark_target_link_qt_macro(${target})
else()
# + + target_depends_str
str_right_v(REALPATH PLUS_INDEX target_depends_str)
string(REPLACE "+" ";" target_depends "${target_depends_str}")
find_dir_plus_v(REALPATH target)
str_left_v(REALPATH PLUS_INDEX dir)
spark_add_library_path(${target}
${dir}
${${target}_ADD_SOURCE}
)
spark_debug_message(" [INCLUDE_DIRS]: ${dir} ${dir}/.. \n")
target_include_directories(${target} PUBLIC ${dir} ${dir}/..)
target_link_libraries(${target} ${target_depends})
endif(PLUS_INDEX LESS 0)
endforeach(REALPATH IN LISTS REALPATHS)
endmacro(spark_add_library_realpaths)
# spark_add_shared_library_realpaths [dirs ...]
#
# :
# : +A+B
macro(spark_add_shared_library_realpaths)
set(REALPATHS ${ARGN})
foreach(REALPATH IN LISTS REALPATHS)
# # : :
# find_colon(${REALPATH} COLON_INDEX)
# / /
find_dir_v(REALPATH SLASH_INDEX REVERSE)
# + +
find_plus_v(REALPATH PLUS_INDEX)
# +
if(PLUS_INDEX LESS 0)
# +
set(dir ${REALPATH})
str_right_v(REALPATH SLASH_INDEX target)
spark_add_library_path(${target} SHARED
${dir}
${${target}_ADD_SOURCE}
)
# 使 spark_add_library_realpaths
target_include_directories(${target} PUBLIC ${dir})
_handle_spark_target_link_qt_macro(${target})
else()
# + + target_depends_str
str_right_v(REALPATH PLUS_INDEX target_depends_str)
string(REPLACE "+" ";" target_depends "${target_depends_str}")
find_dir_plus_v(REALPATH target)
str_left_v(REALPATH PLUS_INDEX dir)
spark_add_library_path(${target} SHARED
${dir}
${${target}_ADD_SOURCE}
)
spark_debug_message(" [INCLUDE_DIRS]: ${dir} ${dir}/.. \n")
target_include_directories(${target} PUBLIC ${dir} ${dir}/..)
target_link_libraries(${target} ${target_depends})
endif(PLUS_INDEX LESS 0)
endforeach(REALPATH IN LISTS REALPATHS)
endmacro(spark_add_shared_library_realpaths)
# spark_aux_source_paths
# AUX
# <var>_PATHS
macro(spark_aux_source_paths AUX_VAR)
set(${AUX_VAR} "")
set(${AUX_VAR}_PATHS ${ARGN})
foreach(aux_path IN LISTS ${AUX_VAR}_PATHS)
# spark_debug_message("aux_path: ${aux_path}")
aux_source_directory(${aux_path} ${AUX_VAR})
endforeach(aux_path IN LISTS ${AUX_VAR}_PATHS)
endmacro(spark_aux_source_paths AUX_VAR)
# spark_file_glob <var> [regexp]...
# 使 file(GLOB)
# <var>_PATHS
macro(spark_file_glob FGLOB_VAR)
set(${FGLOB_VAR} "")
set(${FGLOB_VAR}_PATHS ${ARGN})
foreach(fglob_path IN LISTS ${FGLOB_VAR}_PATHS)
file(GLOB FGLOB_PATH_SRCS ${fglob_path})
foreach(fglob_path_src IN LISTS FGLOB_PATH_SRCS)
# spark_debug_message(" -> ${item}")
list(APPEND ${FGLOB_VAR} ${fglob_path_src})
endforeach(fglob_path_src IN LISTS FGLOB_PATH_SRCS)
endforeach(fglob_path IN LISTS ${FGLOB_VAR}_PATHS)
endmacro(spark_file_glob FGLOB_VAR)
# 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})
spark_aux_source_paths(${SOURCE_VAR} ${ARGN})
foreach(source_path IN LISTS ${SOURCE_VAR}_PATHS)
# list(APPEND ${SOURCE_VAR}_PATHS ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_PATH})
# aux_source_directory(${SOURCE_PATH} _SOURCES)
# foreach(item IN LISTS _SOURCES)
# # spark_debug_message(" -> ${item}")
# list(APPEND ${SOURCE_VAR} ${item})
# endforeach(item IN LISTS _SOURCES)
# file(GLOB HEADER_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${SOURCE_PATH}/*.h)
# foreach(item IN LISTS HEADER_LIST)
# # spark_debug_message(" -> ${item}")
# list(APPEND ${SOURCE_VAR} ${item})
# endforeach(item IN LISTS HEADER_LIST)
file(GLOB UI_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${source_path}/*.ui)
foreach(ui_src IN LISTS UI_SRCS)
# spark_debug_message(" -> ${item}")
list(APPEND ${SOURCE_VAR} ${ui_src})
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)
# spark_add_executable_source <target> ...
#
#
macro(spark_add_executable_source target)
set(${target}_ADD_SOURCE ${ARGN})
endmacro(spark_add_executable_source target)
# spark_add_executable_realpaths dir
macro(_handle_spark_add_executable_realpaths_if_dir_empty_macro)
if("${dir}" STREQUAL "")
spark_add_executable(${target}
${${target}_ADD_SOURCE}
)
else()
spark_add_executable_path(${target}
${dir}
${${target}_ADD_SOURCE}
)
endif("${dir}" STREQUAL "")
endmacro(_handle_spark_add_executable_realpaths_if_dir_empty_macro)
# spark_add_executable_realpaths
#
# : :
# : :+A+B
macro(spark_add_executable_realpaths)
set(REALPATHS ${ARGN})
foreach(REALPATH IN LISTS REALPATHS)
# : :
find_colon(${REALPATH} COLON_INDEX)
if(COLON_INDEX LESS 0)
# do not anything
else()
# : target
# string(SUBSTRING "${REALPATH}" 0 ${COLON_INDEX} REALTARGET)
find_colon_v(REALPATH COLON_INDEX)
str_left_v(REALPATH COLON_INDEX target)
str_right_v(REALPATH COLON_INDEX COLON_REMAIN)
# message(FATAL_ERROR "构建一个: ${target}") #
endif(COLON_INDEX LESS 0)
# + +
find_plus_v(REALPATH PLUS_INDEX)
if(PLUS_INDEX LESS 0)
# +
set(dir ${COLON_REMAIN})
# spark_add_executable_path(${target}
# ${dir}
# ${${target}_ADD_SOURCE}
# )
_handle_spark_add_executable_realpaths_if_dir_empty_macro()
_handle_spark_target_link_qt_macro(${target})
else()
# + + target_depends_str
str_right_v(REALPATH PLUS_INDEX target_depends_str)
string(REPLACE "+" ";" target_depends "${target_depends_str}")
# dir
find_colon_plus_v(REALPATH dir)
# spark_add_executable_path(${target}
# ${dir}
# ${${target}_ADD_SOURCE}
# )
_handle_spark_add_executable_realpaths_if_dir_empty_macro()
target_include_directories(${target} PUBLIC ${dir} ${dir}/..)
target_link_libraries(${target} ${target_depends})
endif(PLUS_INDEX LESS 0)
endforeach(REALPATH IN LISTS REALPATHS)
endmacro(spark_add_executable_realpaths)
#
# 1.
# src/widgets/DocTypeListView
# ^
#
#
# 2.
# src/widgets/MaintainerInfoView+DocTypeListView+...
# ^ MaintainerInfoView
# ^'+'
#
# 1.基于指定的目录路径进行构建(行不通,可执行目标很少为一个目录)
# 2.基于指定的文件路径进行构建(也许可以)
# 3.基于指定的文件名称进行构建()
# 4.基于指定命名规则(target:dir:dir+depend+depend...)
# 集成(一行一库 + 一行一可执行目标)
# 1.基于指定的目录进行构建(适用于library与executable)
# 3.
# s[hared],d[yamic],t[]
# s:dir+depend+depend...
# d:dir+depend+depend...
# t:<target>:dir+depend+depend...
# ^
#
# spark_add_target_realpaths <tag> [realpaths]
# realpaths:
# s: static (s:src/libs/hello)
# d: shared (d:src/libs/say)
# t: target (t:<target>:src+hello+say)
#
# spark_add_executable_realpaths
# spark_add_shared_library_realpaths
# spark_add_library_realpaths
macro(spark_add_target_realpaths tag)
set(${tag}_ARGN ${ARGN})
foreach(item IN LISTS ${tag}_ARGN)
str_left(${item} 1 item_type)
str_right(${item} 1 item_val)
if("${item_type}" STREQUAL "t")
set(item_message "可执行文件")
elseif("${item_type}" STREQUAL "d")
set(item_message "动态库")
elseif("${item_type}" STREQUAL "s")
set(item_message "静态库")
endif("${item_type}" STREQUAL "t")
spark_debug_message("代号: [${tag}] 构建 ${item_val}, 类型: ${item_message}")
spark_debug_message(" * ${item_val}")
if("${item_type}" STREQUAL "t")
spark_add_executable_realpaths(${item_val})
elseif("${item_type}" STREQUAL "d")
spark_add_shared_library_realpaths(${item_val})
elseif("${item_type}" STREQUAL "s")
spark_add_library_realpaths(${item_val})
endif("${item_type}" STREQUAL "t")
spark_debug_message("")
endforeach(item IN LISTS ${tag}_ARGN)
endmacro(spark_add_target_realpaths tag)

View File

@ -1,55 +0,0 @@
cmake_minimum_required(VERSION 3.5.1)
# translator_qt5 _qmvar [... *.ts]
macro(translator_qt5 _qmvar)
# set(SPARK_TRANSLATIONS_ARGN ${ARGN})
# file(GLOB SPARK_TRANSLATIONS ${SPARK_TRANSLATIONS_ARGN})
# qt5_add_translation(SPARK_QM_TRANSLATIONS
# ${SPARK_TRANSLATIONS})
set(${_qmvar}_ARNG ${ARGN})
file(GLOB ${_qmvar}_TS_FILES ${${_qmvar}_ARNG})
find_package(Qt5LinguistTools)
qt5_add_translation(${_qmvar}
${${_qmvar}_TS_FILES})
set(SPARK_QM_TRANSLATIONS ${_qmvar})
spark_debug_message("> QT Translation: ${_qmvar}")
file(WRITE ${CMAKE_BINARY_DIR}/${_qmvar} "")
foreach(item IN LISTS ${_qmvar})
file(APPEND ${CMAKE_BINARY_DIR}/${_qmvar} "${item}\n")
spark_debug_message(" ${item}")
endforeach(item IN LISTS ${_qmvar})
# SPARK_QM_TRANSLATIONS ${_qmvar} add_executable ts
# qt5_create_translation
# ts make clean ts!
# qt5_add_translation
#
endmacro(translator_qt5 _qmvar)
# translator_qt6 _qmvar [... *.ts]
macro(translator_qt6 _qmvar)
# todo
endmacro(translator_qt6 _qmvar)
# translator_qt5 qt6
macro(_handle_spark_translator_qt_macro _outvar)
if(SPARK_FIND_QT5)
translator_qt5(${_outvar} ${ARGN})
endif(SPARK_FIND_QT5)
if(SPARK_FIND_QT6)
translator_qt6(${_outvar} ${ARGN})
endif(SPARK_FIND_QT6)
endmacro(_handle_spark_translator_qt_macro _outvar)
# translator_qt _qmvar [... *.ts | match]
macro(translator_qt)
_handle_spark_translator_qt_macro(${ARGN})
endmacro(translator_qt)

113
cmake/SparkWithGit.cmake Normal file
View File

@ -0,0 +1,113 @@
# Spark WithGit
set(SPARK_FRAMEWORK_TO "${CMAKE_SOURCE_DIR}/cmake/_spark")
function(spark_framework_from_git)
# 1. 使 cmake
# set(OPTIONS)
set(ONEVARG PREFIX)
set(MULVARG COMPONENTS)
cmake_parse_arguments(SPARK "" "${ONEVARG}" "${MULVARG}" ${ARGN})
# 2. PREFIX
if(SPARK_PREFIX)
if(NOT EXISTS "${SPARK_FRAMEWORK_TO}")
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory "${SPARK_FRAMEWORK_TO}")
endif(NOT EXISTS "${SPARK_FRAMEWORK_TO}")
foreach(SPARK_COMPONENT IN LISTS SPARK_COMPONENTS)
# execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory "${SPARK_PREFIX}.${SPARK_COMPONENT}'"
# WORKING_DIRECTORY ${SPARK_FRAMEWORK_TO})
if(NOT EXISTS "${SPARK_FRAMEWORK_TO}/${SPARK_COMPONENT}")
execute_process(COMMAND git clone "${SPARK_PREFIX}/${SPARK_COMPONENT}"
WORKING_DIRECTORY ${SPARK_FRAMEWORK_TO})
else()
message("[SparkWithGit] Exits: ${SPARK_COMPONENT}")
endif(NOT EXISTS "${SPARK_FRAMEWORK_TO}/${SPARK_COMPONENT}")
endforeach(SPARK_COMPONENT IN LISTS SPARK_COMPONENTS)
endif(SPARK_PREFIX)
# .gitignoe
if(NOT EXISTS "${SPARK_FRAMEWORK_TO}/.gitignore")
file(WRITE "${SPARK_FRAMEWORK_TO}/.gitignore" "spark.*/\n.gitignore")
endif(NOT EXISTS "${SPARK_FRAMEWORK_TO}/.gitignore")
# ../.gitignore
# if(NOT EXISTS "${SPARK_FRAMEWORK_TO}/../.gitignore")
# file(WRITE "${SPARK_FRAMEWORK_TO}/../.gitignore" "_spark/\n.gitignore")
# endif(NOT EXISTS "${SPARK_FRAMEWORK_TO}/../.gitignore")
endfunction(spark_framework_from_git)
macro(spark_include)
set(_spark_files ${ARGN})
foreach(_spark_file IN LISTS _spark_files)
if(EXISTS "${_spark_file}")
include(${_spark_file})
continue()
endif(EXISTS "${_spark_file}")
file(GLOB_RECURSE _file RELATIVE "${SPARK_FRAMEWORK_TO}" ${_spark_file})
list(FILTER _file EXCLUDE REGEX "\\.\\.")
if(EXISTS "${SPARK_FRAMEWORK_TO}/${_file}")
message("FOUND: ${SPARK_FRAMEWORK_TO}/${_file}")
include("${SPARK_FRAMEWORK_TO}/${_file}")
else()
message(WARNING "NOT FOUND: ${SPARK_FRAMEWORK_TO}/${_file}")
endif(EXISTS "${SPARK_FRAMEWORK_TO}/${_file}")
endforeach(_spark_file IN LISTS _spark_files)
endmacro(spark_include)
# Spark
spark_framework_from_git(
PREFIX
http://gitee.com/zinface/
COMPONENTS
spark.assets-icon
spark.env
spark.macros
spark.find-qt5
spark.find-qt6
spark.find-dtk
spark.find-library
spark.macros-extend
spark.build-graphviz
spark.framework
spark.cmake-info
spark.external-project
spark.translator-macro
spark.install-macros
spark.desktop-macro
spark.deb-package
spark.appimage-macros-online
)
# include(cmake/SparkWithGit.cmake)
# spark_include
# spark_include(
# SparkEnvConfig.cmake
# SparkMacrosConfig.cmake
# SparkFindQt5Config.cmake
# SparkFindQt6Config.cmake
# SparkFindDtkConfig.cmake
# SparkFindLibraries.cmake
# SparkMacrosExtendConfig.cmake
# SparkFramework.cmake
# SparkCMakeInfoAfterConfig.cmake
# SparkCMakeInfoBeforeConfig.cmake
# SparkExternalProject.cmake
# SparkTranslatorConfig.cmake
# SparkInstallMacrosConfig.cmake
# SparkBuildGraphviz.cmake
# SparkDesktopMacros.cmake
# SparkDebPackageConfig.cmake
# SparkAppimageConfig.cmake
# )

View File

@ -19,7 +19,7 @@ option(USE_LINUX_APPIMAGE "为 Linux 生成 Appimage 可执行程序" OFF)
if(USE_LINUX_APPIMAGE)
include(cmake/SparkDesktopMacros.cmake)
spark_include(cmake/SparkDesktopMacros.cmake)
# : Name=
spark_desktop_macros(
# : Name=
@ -40,7 +40,7 @@ if(USE_LINUX_APPIMAGE)
)
# 1. Appimage
include(cmake/SparkAppimageConfig.cmake) # Spark Appimage
spark_include(cmake/SparkAppimageConfig.cmake) # Spark Appimage
add_appimage_icon(assets/spark.png) # Appimage
add_appimage_desktop() # Appimage 中的默认desktop(使用来自 Spark 构建的 Desktop 构建中配置的信息(必须要求 spark-desktop))
add_appimage_target(${PROJECT_NAME}) # Appimage Appimage

View File

@ -9,7 +9,7 @@ option(USE_LINUX_DEBIAN "为 Linux 生成 deb 软件包" OFF)
if(USE_LINUX_DEBIAN)
find_package(SparkDebPackage PATHS ${CMAKE_SOURCE_DIR})
spark_include(SparkDebPackageConfig.cmake)
add_package_descript(cmake/spark-deb-package.descript)
endif(USE_LINUX_DEBIAN)

View File

@ -66,7 +66,7 @@ if(USE_LINUX_UOS)
# set(PACKAGE_SUFFIX "_onlyUos")
# 2. 使 debian deb
find_package(SparkDebPackage PATHS ${CMAKE_SOURCE_DIR})
spark_include(SparkDebPackageConfig.cmake)
add_package_descript(cmake/spark-deb-package.descript)
endif(USE_LINUX_UOS)

View File

@ -12,91 +12,13 @@
# 使
# 使 spark_file_glob
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: ")
message(" ${FRAMEWORK_INCLUDE_EXPORTS}")
message("-- [FRAMEWORK ANALYZE]: ${_target} Want Files: ")
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})
spark_framework_include(${_target} ${_plug_cmake})
endmacro(framework_plugin_include _target _plug_cmake)
# framework_plugin_include_with_git <target> <git_repo_url> [git_args...]
# git plugin.cmake
function(framework_plugin_include_with_git _target GIT_REPO_URL)
set(GIT_ARGS ${ARGN})
# 1.
string(REGEX MATCHALL "^http://" HTTP_VAR "${GIT_REPO_URL}")
string(REGEX MATCHALL "^https://" HTTPS_VAR "${GIT_REPO_URL}")
# 2.
if(HTTP_VAR STREQUAL "http://")
string(REPLACE "${HTTP_VAR}" "" REPO_URL "${GIT_REPO_URL}")
elseif(HTTPS_VAR STREQUAL "https://")
string(REPLACE "${HTTPS_VAR}" "" REPO_URL "${GIT_REPO_URL}")
else()
return()
endif(HTTP_VAR STREQUAL "http://")
# 3. cmake LIST
string(REPLACE "/" ";" URLSEGS ${REPO_URL})
list(LENGTH URLSEGS URLSEGS_LENGTH)
# 4.
if(URLSEGS_LENGTH GREATER_EQUAL 3)
list(GET URLSEGS 0 URL_DOMAIN)
list(GET URLSEGS 1 URL_USER)
list(GET URLSEGS 2 URL_REPO)
else()
return()
endif(URLSEGS_LENGTH GREATER_EQUAL 3)
message("HTTP_VAR: ${HTTP_VAR}")
message("HTTPS_VAR: ${HTTPS_VAR}")
message("URL_DOMAIN: ${URL_DOMAIN}")
message("URL_USER: ${URL_USER}")
message("URL_REPO: ${URL_REPO}")
# 4. git clone
# domain
# user
# repo
if(NOT EXISTS ${CMAKE_SOURCE_DIR}/3rd_plugins_cache/${URL_DOMAIN}/${URL_USER}/${URL_REPO}_git)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory "${URL_DOMAIN}/${URL_USER}"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/3rd_plugins_cache)
execute_process(COMMAND git clone ${GIT_REPO_URL} ${URL_DOMAIN}/${URL_USER}/${URL_REPO}_git ${GIT_ARGS}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/3rd_plugins_cache)
else()
execute_process(COMMAND git pull
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/3rd_plugins_cache/${URL_DOMAIN}/${URL_USER}/${URL_REPO}_git)
endif(NOT EXISTS ${CMAKE_SOURCE_DIR}/3rd_plugins_cache/${URL_DOMAIN}/${URL_USER}/${URL_REPO}_git)
if(EXISTS ${CMAKE_SOURCE_DIR}/3rd_plugins_cache/${URL_DOMAIN}/${URL_USER}/${URL_REPO}_git/plugin.cmake)
# message("-- [WANT_GIT_PLUGIN] Found new plugin with git: ${CMAKE_SOURCE_DIR}/3rd_plugins_cache/${URL_DOMAIN}/${URL_USER}/${URL_REPO}_git/plugin.cmake")
message("-- [WANT_GIT_PLUGIN] Found new plugin with git: ")
message(" ${CMAKE_SOURCE_DIR}/3rd_plugins_cache/${URL_DOMAIN}/${URL_USER}/${URL_REPO}_git/plugin.cmake")
# set(WITH_GIT ON)
framework_plugin_include(${_target}
${CMAKE_SOURCE_DIR}/3rd_plugins_cache/${URL_DOMAIN}/${URL_USER}/${URL_REPO}_git/plugin.cmake)
else()
message("-- [WANT_GIT_PLUGIN] Not Found plugin.cmake with git: ${GIT_REPO_URL}")
return()
endif(EXISTS ${CMAKE_SOURCE_DIR}/3rd_plugins_cache/${URL_DOMAIN}/${URL_USER}/${URL_REPO}_git/plugin.cmake)
spark_framework_include_with_git(${_target} ${GIT_REPO_URL} ${ARGN})
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)

View File

@ -108,61 +108,6 @@ endmacro(add_framework_plugin _target)
# add_framework_plugin_with_git <git_repo_url> [git_args...]
# git
macro(add_framework_plugin_with_git GIT_REPO_URL)
set(GIT_ARGS ${ARGN})
# 1.
string(REGEX MATCHALL "^http://" HTTP_VAR "${GIT_REPO_URL}")
string(REGEX MATCHALL "^https://" HTTPS_VAR "${GIT_REPO_URL}")
# 2.
if(HTTP_VAR STREQUAL "http://")
string(REPLACE "${HTTP_VAR}" "" REPO_URL "${GIT_REPO_URL}")
elseif(HTTPS_VAR STREQUAL "https://")
string(REPLACE "${HTTPS_VAR}" "" REPO_URL "${GIT_REPO_URL}")
else()
return()
endif(HTTP_VAR STREQUAL "http://")
# 3. cmake LIST
string(REPLACE "/" ";" URLSEGS ${REPO_URL})
list(LENGTH URLSEGS URLSEGS_LENGTH)
# 4.
if(URLSEGS_LENGTH GREATER_EQUAL 3)
list(GET URLSEGS 0 URL_DOMAIN)
list(GET URLSEGS 1 URL_USER)
list(GET URLSEGS 2 URL_REPO)
else()
return()
endif(URLSEGS_LENGTH GREATER_EQUAL 3)
message("HTTP_VAR: ${HTTP_VAR}")
message("HTTPS_VAR: ${HTTPS_VAR}")
message("URL_DOMAIN: ${URL_DOMAIN}")
message("URL_USER: ${URL_USER}")
message("URL_REPO: ${URL_REPO}")
# 4. git clone
# domain
# user
# repo
if(NOT EXISTS ${CMAKE_SOURCE_DIR}/3rd_plugins_cache/${URL_DOMAIN}/${URL_USER}/${URL_REPO}_git)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory "${URL_DOMAIN}/${URL_USER}"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/3rd_plugins_cache)
execute_process(COMMAND git clone ${GIT_REPO_URL} ${URL_DOMAIN}/${URL_USER}/${URL_REPO}_git ${GIT_ARGS}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/3rd_plugins_cache)
else()
execute_process(COMMAND git pull
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/3rd_plugins_cache/${URL_DOMAIN}/${URL_USER}/${URL_REPO}_git)
endif(NOT EXISTS ${CMAKE_SOURCE_DIR}/3rd_plugins_cache/${URL_DOMAIN}/${URL_USER}/${URL_REPO}_git)
# 6. plugin.cmake
if(EXISTS ${CMAKE_SOURCE_DIR}/3rd_plugins_cache/${URL_DOMAIN}/${URL_USER}/${URL_REPO}_git/plugin.cmake)
message("-- [GIT_PLUGIN] Found new plugin with git: ")
message(" ${CMAKE_SOURCE_DIR}/3rd_plugins_cache/${URL_DOMAIN}/${URL_USER}/${URL_REPO}_git/plugin.cmake")
set(WITH_GIT ON)
include(${CMAKE_SOURCE_DIR}/3rd_plugins_cache/${URL_DOMAIN}/${URL_USER}/${URL_REPO}_git/plugin.cmake)
else()
return()
endif(EXISTS ${CMAKE_SOURCE_DIR}/3rd_plugins_cache/${URL_DOMAIN}/${URL_USER}/${URL_REPO}_git/plugin.cmake)
set(WITH_GIT ON)
spark_framework_include_with_git(_ ${GIT_REPO_URL} ${ARGN})
endmacro(add_framework_plugin_with_git GIT_REPO_URL)