This is an automated email from the ASF dual-hosted git repository. ColinLeeo pushed a commit to branch support_apt_package in repository https://gitbox.apache.org/repos/asf/tsfile.git
commit dfdb6461e309425882e54ce5ef61662bd43af49a Author: ColinLee <[email protected]> AuthorDate: Thu Jul 9 15:49:55 2026 +0800 Support Maven CPack packaging --- cpp/README-zh.md | 14 +++++++++++++- cpp/README.md | 14 +++++++++++++- cpp/pom.xml | 17 +++++++++++++++++ 3 files changed, 43 insertions(+), 2 deletions(-) diff --git a/cpp/README-zh.md b/cpp/README-zh.md index 68f7a7c2b..6a532d1a6 100644 --- a/cpp/README-zh.md +++ b/cpp/README-zh.md @@ -130,7 +130,19 @@ C++ CMake 构建可以生成 Linux 发行版可安装包: - Debian/Ubuntu:`libtsfile`、`libtsfile-dev`、`tsfile-cli` DEB 包 - RHEL/CentOS/Fedora:`libtsfile`、`libtsfile-devel`、`tsfile-cli` RPM 包 -在 `cpp/` 目录下执行: +在仓库根目录下,Maven 会先构建 C++ 模块,然后调用 CPack: + +```bash +./mvnw package -P with-cpp +``` + +如果只需要快速生成安装包、不运行 C++ 测试: + +```bash +./mvnw package -P with-cpp -Dbuild.test=OFF -DskipTests +``` + +也可以在 `cpp/` 目录下直接调用 CMake: ```bash cmake -S . -B build/package -DCMAKE_BUILD_TYPE=Release diff --git a/cpp/README.md b/cpp/README.md index 23714a096..ea74d3d35 100644 --- a/cpp/README.md +++ b/cpp/README.md @@ -152,7 +152,19 @@ The C++ CMake build can generate installable packages for Linux distributions: - Debian/Ubuntu: `libtsfile`, `libtsfile-dev`, `tsfile-cli` DEB packages - RHEL/CentOS/Fedora: `libtsfile`, `libtsfile-devel`, `tsfile-cli` RPM packages -From the `cpp/` directory: +From the repository root, Maven builds the C++ module and then invokes CPack: + +```bash +./mvnw package -P with-cpp +``` + +For a faster package-only build without running C++ tests: + +```bash +./mvnw package -P with-cpp -Dbuild.test=OFF -DskipTests +``` + +To invoke CMake directly from the `cpp/` directory: ```bash cmake -S . -B build/package -DCMAKE_BUILD_TYPE=Release diff --git a/cpp/pom.xml b/cpp/pom.xml index 153e75dc2..62a776826 100644 --- a/cpp/pom.xml +++ b/cpp/pom.xml @@ -119,6 +119,23 @@ <config>${build.type}</config> </configuration> </execution> + <!-- Build the CPack package target during the Maven package phase. --> + <execution> + <id>cmake-package</id> + <phase>package</phase> + <goals> + <goal>compile</goal> + </goals> + <configuration> + <!-- + Build configuration for multi-config generators + (Visual Studio). Ignored by single-config + generators such as the Makefile generators. + --> + <config>${build.type}</config> + <target>package</target> + </configuration> + </execution> <!-- Execute the tests --> <execution> <id>cmake-run-tests</id>
