[Cmake-commits] CMake branch, next, updated. v3.4.0-1536-ga2d81f6
Brad King
brad.king at kitware.com
Mon Nov 30 11:53:08 EST 2015
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 a2d81f68df75eba057b47b96a7dcab81bee75ece (commit)
via 565661ea6680b27fcb8b433c4bef94a0bd1dd2ca (commit)
from aad2a58ff2946212d9d6f6de24a5b756fb482701 (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=a2d81f68df75eba057b47b96a7dcab81bee75ece
commit a2d81f68df75eba057b47b96a7dcab81bee75ece
Merge: aad2a58 565661e
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Nov 30 11:53:07 2015 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Nov 30 11:53:07 2015 -0500
Merge topic 'cpack-dmg-multilanguage-sla' into next
565661ea CPack/DragNDrop: Allow single license for multiple languages
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=565661ea6680b27fcb8b433c4bef94a0bd1dd2ca
commit 565661ea6680b27fcb8b433c4bef94a0bd1dd2ca
Author: Simon Levermann <Simon.Levermann at governikus.de>
AuthorDate: Tue Nov 24 16:17:53 2015 +0100
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Nov 30 11:52:31 2015 -0500
CPack/DragNDrop: Allow single license for multiple languages
When both CPACK_DMG_SLA_DIR and CPACK_RESOURCE_FILE_LICENSE are defined,
use the license file for all languages instead of looking for a license
file for each language. Also expand the documentation on the SLA
variables.
diff --git a/Modules/CPackDMG.cmake b/Modules/CPackDMG.cmake
index 6b5af7e..e34f8cd 100644
--- a/Modules/CPackDMG.cmake
+++ b/Modules/CPackDMG.cmake
@@ -49,11 +49,29 @@
# .. variable:: CPACK_DMG_SLA_DIR
#
# Directory where license and menu files for different languages are stored.
+# Setting this causes CPack to look for a ``<language>.menu.txt`` and
+# ``<language>.license.txt`` file for every language defined in
+# ``CPACK_DMG_SLA_LANGUAGES``. If both this variable and
+# ``CPACK_RESOURCE_FILE_LICENSE`` are set, CPack will only look for the menu
+# files and use the same license file for all languages.
#
# .. variable:: CPACK_DMG_SLA_LANGUAGES
#
# Languages for which a license agreement is provided when mounting the
-# generated DMG.
+# generated DMG. A menu file consists of 9 lines of text. The first line is
+# is the name of the language itself, uppercase, in English (e.g. German).
+# The other lines are translations of the following strings:
+#
+# - Agree
+# - Disagree
+# - Print
+# - Save...
+# - You agree to the terms of the License Agreement when you click the
+# "Agree" button.
+# - Software License Agreement
+# - This text cannot be saved. The disk may be full or locked, or the file
+# may be locked.
+# - Unable to print. Make sure you have selected a printer.
#
# For every language in this list, CPack will try to find files
# ``<language>.menu.txt`` and ``<language>.license.txt`` in the directory
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index b5df2d0..31665da 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -131,10 +131,11 @@ int cmCPackDragNDropGenerator::InitializeInternal()
if(!license_file.empty() &&
(license_file.find("CPack.GenericLicense.txt") == std::string::npos))
{
- cmCPackLogger(cmCPackLog::LOG_WARNING,
+ cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"Both CPACK_DMG_SLA_DIR and CPACK_RESOURCE_FILE_LICENSE specified, "
- "defaulting to CPACK_DMG_SLA_DIR"
+ "using CPACK_RESOURCE_FILE_LICENSE as a license for all languages."
<< std::endl);
+ singleLicense = true;
}
}
if(!this->IsSet("CPACK_DMG_SLA_LANGUAGES"))
@@ -166,7 +167,7 @@ int cmCPackDragNDropGenerator::InitializeInternal()
for(size_t i = 0; i < languages.size(); ++i)
{
std::string license = slaDirectory + "/" + languages[i] + ".license.txt";
- if (!cmSystemTools::FileExists(license))
+ if (!singleLicense && !cmSystemTools::FileExists(license))
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Missing license file " << languages[i] << ".license.txt"
@@ -366,7 +367,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
// use sla_dir if both sla_dir and license_file are set
if(!cpack_license_file.empty() &&
- !slaDirectory.empty())
+ !slaDirectory.empty() && !singleLicense)
{
cpack_license_file = "";
}
@@ -699,7 +700,14 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
{
for(size_t i = 0; i < languages.size(); ++i)
{
- WriteLicense(ofs, i + 5000, languages[i]);
+ if(singleLicense)
+ {
+ WriteLicense(ofs, i + 5000, languages[i], cpack_license_file);
+ }
+ else
+ {
+ WriteLicense(ofs, i + 5000, languages[i]);
+ }
}
}
@@ -850,7 +858,7 @@ void
cmCPackDragNDropGenerator::WriteLicense(cmGeneratedFileStream& outputStream,
int licenseNumber, std::string licenseLanguage, std::string licenseFile)
{
- if(!licenseFile.empty())
+ if(!licenseFile.empty() && !singleLicense)
{
licenseNumber = 5002;
licenseLanguage = "English";
@@ -887,7 +895,7 @@ cmCPackDragNDropGenerator::WriteLicense(cmGeneratedFileStream& outputStream,
// End of License
outputStream << "};\n\n";
- if(!licenseFile.empty())
+ if(!licenseFile.empty() && !singleLicense)
{
outputStream << SLASTREnglish;
}
diff --git a/Source/CPack/cmCPackDragNDropGenerator.h b/Source/CPack/cmCPackDragNDropGenerator.h
index 53d38c4..92ec845 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.h
+++ b/Source/CPack/cmCPackDragNDropGenerator.h
@@ -48,6 +48,7 @@ protected:
private:
std::string slaDirectory;
+ bool singleLicense = false;
void WriteLicense(cmGeneratedFileStream& outputStream, int licenseNumber,
std::string licenseLanguage, std::string licenseFile = "");
-----------------------------------------------------------------------
Summary of changes:
Modules/CPackDMG.cmake | 20 +++++++++++++++++++-
Source/CPack/cmCPackDragNDropGenerator.cxx | 22 +++++++++++++++-------
Source/CPack/cmCPackDragNDropGenerator.h | 1 +
3 files changed, 35 insertions(+), 8 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list