[Cmake-commits] CMake branch, next, updated. v3.7.2-2546-g3d4e634
Brad King
brad.king at kitware.com
Sat Feb 4 08:08:27 EST 2017
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 3d4e6340f31d9c5b15ad0a748a7295eaea7e8943 (commit)
via 48aad9cda099005f5f58a7e83d604877f6f84c6d (commit)
from 8c3b29c2afeb30fcf54e2c0025d4663515f904cb (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3d4e6340f31d9c5b15ad0a748a7295eaea7e8943
commit 3d4e6340f31d9c5b15ad0a748a7295eaea7e8943
Merge: 8c3b29c 48aad9c
Author: Brad King <brad.king at kitware.com>
AuthorDate: Sat Feb 4 08:08:26 2017 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Feb 4 08:08:26 2017 -0500
Merge topic 'productbuild_signing' into next
48aad9cd CPackProductBuild: Add options to sign packages
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=48aad9cda099005f5f58a7e83d604877f6f84c6d
commit 48aad9cda099005f5f58a7e83d604877f6f84c6d
Author: Roman Wüger <office at wueger.at>
AuthorDate: Sun Jan 15 01:29:34 2017 +0100
Commit: Brad King <brad.king at kitware.com>
CommitDate: Sat Feb 4 08:07:48 2017 -0500
CPackProductBuild: Add options to sign packages
diff --git a/Help/release/dev/cpack-productbuild-signing.rst b/Help/release/dev/cpack-productbuild-signing.rst
new file mode 100644
index 0000000..0b91b38
--- /dev/null
+++ b/Help/release/dev/cpack-productbuild-signing.rst
@@ -0,0 +1,8 @@
+cpack-productbuild-signing
+--------------------------
+
+* The :module:`CPackProductBuild` module gained options to sign packages.
+ See the variables :variable:`CPACK_PRODUCTBUILD_IDENTITY_NAME`,
+ :variable:`CPACK_PRODUCTBUILD_KEYCHAIN_PATH`,
+ :variable:`CPACK_PKGBUILD_IDENTITY_NAME`, and
+ :variable:`CPACK_PKGBUILD_KEYCHAIN_PATH`.
diff --git a/Modules/CPackProductBuild.cmake b/Modules/CPackProductBuild.cmake
index ea2fa7c..d545d3e 100644
--- a/Modules/CPackProductBuild.cmake
+++ b/Modules/CPackProductBuild.cmake
@@ -20,9 +20,29 @@
# the automatically detected command (or specify its location if the
# auto-detection fails to find it.)
#
+# .. variable:: CPACK_PRODUCTBUILD_IDENTITY_NAME
+#
+# Adds a digital signature to the resulting package.
+#
+#
+# .. variable:: CPACK_PRODUCTBUILD_KEYCHAIN_PATH
+#
+# Specify a specific keychain to search for the signing identity.
+#
+#
# .. variable:: CPACK_COMMAND_PKGBUILD
#
# Path to the pkgbuild(1) command used to generate an OS X component package
# on OS X. This variable can be used to override the automatically detected
# command (or specify its location if the auto-detection fails to find it.)
#
+#
+# .. variable:: CPACK_PKGBUILD_IDENTITY_NAME
+#
+# Adds a digital signature to the resulting package.
+#
+#
+# .. variable:: CPACK_PKGBUILD_KEYCHAIN_PATH
+#
+# Specify a specific keychain to search for the signing identity.
+#
diff --git a/Source/CPack/cmCPackProductBuildGenerator.cxx b/Source/CPack/cmCPackProductBuildGenerator.cxx
index a46e3a6..a5a18dc 100644
--- a/Source/CPack/cmCPackProductBuildGenerator.cxx
+++ b/Source/CPack/cmCPackProductBuildGenerator.cxx
@@ -75,6 +75,14 @@ int cmCPackProductBuildGenerator::PackageFiles()
std::string version = this->GetOption("CPACK_PACKAGE_VERSION");
std::string productbuild = this->GetOption("CPACK_COMMAND_PRODUCTBUILD");
+ std::string identityName;
+ if (const char* n = this->GetOption("CPACK_PRODUCTBUILD_IDENTITY_NAME")) {
+ identityName = n;
+ }
+ std::string keychainPath;
+ if (const char* p = this->GetOption("CPACK_PRODUCTBUILD_KEYCHAIN_PATH")) {
+ keychainPath = p;
+ }
pkgCmd << productbuild << " --distribution \"" << packageDirFileName
<< "/Contents/distribution.dist\""
@@ -82,6 +90,9 @@ int cmCPackProductBuildGenerator::PackageFiles()
<< "\""
<< " --resources \"" << resDir << "\""
<< " --version \"" << version << "\""
+ << (identityName.empty() ? "" : " --sign \"" + identityName + "\"")
+ << (keychainPath.empty() ? ""
+ : " --keychain \"" + keychainPath + "\"")
<< " \"" << packageFileNames[0] << "\"";
// Run ProductBuild
@@ -193,12 +204,23 @@ bool cmCPackProductBuildGenerator::GenerateComponentPackage(
std::string version = this->GetOption("CPACK_PACKAGE_VERSION");
std::string pkgbuild = this->GetOption("CPACK_COMMAND_PKGBUILD");
+ std::string identityName;
+ if (const char* n = this->GetOption("CPACK_PKGBUILD_IDENTITY_NAME")) {
+ identityName = n;
+ }
+ std::string keychainPath;
+ if (const char* p = this->GetOption("CPACK_PKGBUILD_KEYCHAIN_PATH")) {
+ keychainPath = p;
+ }
pkgCmd << pkgbuild << " --root \"" << packageDir << "\""
<< " --identifier \"" << pkgId << "\""
<< " --scripts \"" << scriptDir << "\""
<< " --version \"" << version << "\""
<< " --install-location \"/\""
+ << (identityName.empty() ? "" : " --sign \"" + identityName + "\"")
+ << (keychainPath.empty() ? ""
+ : " --keychain \"" + keychainPath + "\"")
<< " \"" << packageFile << "\"";
// Run ProductBuild
-----------------------------------------------------------------------
Summary of changes:
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list