summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-03-23 13:18:40 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-03-23 13:18:40 (GMT)
commited99514fc1f77ac48dfffbf4fec4a08bff56976f (patch)
tree5872a70269d8dd1c965eac30c5db1fd6870bc9cd
parent114ddb072ce309df64806800550823f656845e77 (diff)
parentfb3e4de8e81f5f14edd2123f53ae1eaed7c37172 (diff)
downloadCMake-ed99514fc1f77ac48dfffbf4fec4a08bff56976f.zip
CMake-ed99514fc1f77ac48dfffbf4fec4a08bff56976f.tar.gz
CMake-ed99514fc1f77ac48dfffbf4fec4a08bff56976f.tar.bz2
Merge topic 'cpack-bundle-codesign'
fb3e4de8 CPack: Add support to overwrite or pass additional parameter to codesign
-rw-r--r--Modules/CPackBundle.cmake5
-rw-r--r--Source/CPack/cmCPackBundleGenerator.cxx14
2 files changed, 16 insertions, 3 deletions
diff --git a/Modules/CPackBundle.cmake b/Modules/CPackBundle.cmake
index d26a0b3..b412216 100644
--- a/Modules/CPackBundle.cmake
+++ b/Modules/CPackBundle.cmake
@@ -52,6 +52,11 @@
# list the main application folder, or the main executable. You should
# list any frameworks and plugins that are included in your app bundle.
#
+# .. variable:: CPACK_BUNDLE_APPLE_CODESIGN_PARAMETER
+#
+# Additional parameter that will passed to codesign.
+# Default value: "--deep -f"
+#
# .. variable:: CPACK_COMMAND_CODESIGN
#
# Path to the codesign(1) command used to sign applications with an
diff --git a/Source/CPack/cmCPackBundleGenerator.cxx b/Source/CPack/cmCPackBundleGenerator.cxx
index 6e7a26b..b2d7019 100644
--- a/Source/CPack/cmCPackBundleGenerator.cxx
+++ b/Source/CPack/cmCPackBundleGenerator.cxx
@@ -221,6 +221,11 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir)
bundle_path += ".app";
// A list of additional files to sign, ie. frameworks and plugins.
+ const std::string sign_parameter =
+ this->GetOption("CPACK_BUNDLE_APPLE_CODESIGN_PARAMETER")
+ ? this->GetOption("CPACK_BUNDLE_APPLE_CODESIGN_PARAMETER")
+ : "--deep -f";
+
const std::string sign_files =
this->GetOption("CPACK_BUNDLE_APPLE_CODESIGN_FILES")
? this->GetOption("CPACK_BUNDLE_APPLE_CODESIGN_FILES") : "";
@@ -234,7 +239,8 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir)
{
std::ostringstream temp_sign_file_cmd;
temp_sign_file_cmd << this->GetOption("CPACK_COMMAND_CODESIGN");
- temp_sign_file_cmd << " --deep -f -s \"" << cpack_apple_cert_app;
+ temp_sign_file_cmd << " " << sign_parameter << " -s \""
+ << cpack_apple_cert_app;
temp_sign_file_cmd << "\" -i ";
temp_sign_file_cmd << this->GetOption("CPACK_APPLE_BUNDLE_ID");
temp_sign_file_cmd << " \"";
@@ -254,7 +260,8 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir)
// sign main binary
std::ostringstream temp_sign_binary_cmd;
temp_sign_binary_cmd << this->GetOption("CPACK_COMMAND_CODESIGN");
- temp_sign_binary_cmd << " --deep -f -s \"" << cpack_apple_cert_app;
+ temp_sign_binary_cmd << " " << sign_parameter << " -s \""
+ << cpack_apple_cert_app;
temp_sign_binary_cmd << "\" \"" << bundle_path << "\"";
if(!this->RunCommand(temp_sign_binary_cmd, &output))
@@ -269,7 +276,8 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir)
// sign app bundle
std::ostringstream temp_codesign_cmd;
temp_codesign_cmd << this->GetOption("CPACK_COMMAND_CODESIGN");
- temp_codesign_cmd << " --deep -f -s \"" << cpack_apple_cert_app << "\"";
+ temp_codesign_cmd << " " << sign_parameter << " -s \""
+ << cpack_apple_cert_app << "\"";
if(this->GetOption("CPACK_BUNDLE_APPLE_ENTITLEMENTS"))
{
temp_codesign_cmd << " --entitlements ";