mirror of https://gitee.com/cxasm/notepad--.git
spark: 探索 spark with git 构建 - 移除部分项目内模块
This commit is contained in:
parent
1346c6ad6a
commit
0ba627d75b
|
@ -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 功能
|
||||
|
|
|
@ -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 可搜索到库的位置
|
|
@ -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}"
|
||||
)
|
|
@ -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}")
|
|
@ -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}" )
|
|
@ -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")
|
|
@ -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
|
||||
# )
|
|
@ -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)
|
|
@ -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)
|
||||
|
|
@ -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)
|
|
@ -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)
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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)
|
|
@ -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)
|
|
@ -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
|
||||
# )
|
|
@ -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 的构建
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue