Browse Source

repo: 通用 Linux 平台的 Debian deb 构建

zinface 2 years ago
parent
commit
7a3ee61a91
4 changed files with 40 additions and 1 deletions
  1. 1 1
      CMakeLists.txt
  2. 18 0
      cmake/platforms/linux-debian.cmake
  3. 19 0
      linux-debian.mk
  4. 2 0
      linux.mk

+ 1 - 1
CMakeLists.txt

@@ -57,7 +57,7 @@ elseif(UNIX AND NOT APPLE AND NOT WIN32 AND NOT ANDROID)
 
         # 通用 Linux 平台的 Debian deb 构建
         if(USE_LINUX_DEBIAN)    
-            # include(cmake/platforms/linux-debian.cmake)
+            include(cmake/platforms/linux-debian.cmake)
         endif()
 
         # 通用 Linux 平台的  Appimage  构建

+ 18 - 0
cmake/platforms/linux-debian.cmake

@@ -0,0 +1,18 @@
+# linux-debian.cmake
+
+# 此构建表示,在 Linux 中以通用平台的构建方式进行 Debian 打包
+
+# 1. 在 cmake/package-deb.descript 中提供标准软件包描述信息
+# 2. 在 DebPackageConfig.cmake 构建模块中分析与自动化配置
+
+option(USE_LINUX_DEBIAN "为 Linux 生成 deb 软件包" OFF)
+
+if(USE_LINUX_DEBIAN)
+    
+    find_package(DebPackage PATHS ${CMAKE_SOURCE_DIR})
+    add_package_descript(cmake/package-deb.descript)
+
+endif(USE_LINUX_DEBIAN)
+
+
+

+ 19 - 0
linux-debian.mk

@@ -0,0 +1,19 @@
+# Linux Debian - 通用 Linux 平台 Debian 构建方案
+
+include linux-universal.mk
+
+CPUS=$(shell nproc)
+
+# builddir  := build
+# sourcedir := .
+# CMAKE_DEBUG     := -DCMAKE_BUILD_TYPE=Debug
+# CMAKE_RELEASE   := -DCMAKE_BUILD_TYPE=Release
+CMAKE_OPTIONS   := -DUSE_LINUX_DEBIAN=ON $(CMAKE_OPTIONS)
+
+package: linux-universal-release
+	make -C $(builddir) package
+
+linux-build-options:
+	@echo $(CMAKE_OPTIONS)
+
+# 此配置为构建 linux debian 通用版本构建

+ 2 - 0
linux.mk

@@ -1,8 +1,10 @@
 Msg   := 'Build with the following configuration:'
 One   := '1. make -f linux-universal.mk'
+Two   := '2. make -f linux-debian.mk package'
 
 
 all:
 	@echo $(Msg)
 	@echo $(One)    "\n\t默认的通用 Linux 平台构建."
+	@echo $(Two)    "\n\t通用 Linux 平台的 Debian deb 构建."