[cmake-developers] [CPackDMG][Patch] Enable use of single license for multiple languages

2015-11-26 Thread Levermann, Simon
Hi,

since license texts are often not translated into other languages, this
patch enables the CPack DragnDrop generator to use a single license
file for all languages instead of having to keep a copy of the same
file around under multiple different names.

Kind regards,
Simon LevermannFrom 65344478186a9e93bb70d8e6c2616e87cafe1c73 Mon Sep 17 00:00:00 2001
From: Simon Levermann 
Date: Tue, 24 Nov 2015 16:17:53 +0100
Subject: [PATCH] Allow single license for multiple languages

When both CPACK_DMG_SLA_DIR and CPACK_RESOURCE_FILE_LICENSE are defined,
CPack now uses the license file for all languages, instead of looking for
a license file for each language. Also expands the documentation on the
SLA variables.
---
 Modules/CPackDMG.cmake | 19 ++-
 Source/CPack/cmCPackDragNDropGenerator.cxx | 22 +++---
 Source/CPack/cmCPackDragNDropGenerator.h   |  1 +
 3 files changed, 34 insertions(+), 8 deletions(-)

diff --git a/Modules/CPackDMG.cmake b/Modules/CPackDMG.cmake
index 6b5af7e..12efcd9 100644
--- a/Modules/CPackDMG.cmake
+++ b/Modules/CPackDMG.cmake
@@ -49,11 +49,28 @@
 # .. 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
 #   ``.menu.txt`` and ``.license.txt`` in the directory
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 7a93fc6..a686577 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_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";
-  

Re: [cmake-developers] [PATCH] Fix Resource directory structure for iOS Bundles (Framework and Application), and update documentation

2015-11-26 Thread Bartosz Kosiorek
Good Morning/Evening.

I applied all post review comments.
Feedback is much welcomed.

Thanks in advance
Bartosz

-Original Message-
From: Brad King [mailto:brad.k...@kitware.com] 
Sent: Friday, November 20, 2015 3:17 PM
To: Bartosz Kosiorek
Cc: cmake-developers@cmake.org; Gregor Jasny
Subject: Re: [cmake-developers] [PATCH] Fix Resource directory structure for 
iOS Bundles (Framework and Application), and update documentation

On 11/18/2015 11:05 AM, Bartosz Kosiorek wrote:
> With this simple patch in attachment I would like to do two things:

Thanks for working on this.  Here are some comments on the documentation.

> +This property may be set to a list of files to be placed in the 
> +corresponding  directory (eg. ``Resources`` directory for OS X) 
> +inside the bundle.  On non-Apple

Please wrap long lines.

> +Following example of Application Bundle:
> +::
> +  add_executable(ExecutableTarget
> +addDemo.c
> +resourcefile.txt
> +appresourcedir/appres.txt
> +  )

CMake code examples should use the `.. code-block:: cmake` directive.

> +  set_target_properties(ExecutableTarget PROPERTIES
> +MACOSX_BUNDLE TRUE
> +MACOSX_FRAMEWORK_IDENTIFIER org.cmake.ExecutableTarget
> +RESOURCE "${RESOURCE_FILES}"
> +  )
> +::

In reStructuredText syntax there is no trailing `::` in code blocks.

> +
> +will produce flat structure for iOS systems:
> +::
> +  ExecutableTarget.app
> +appres.txt
> +ExecutableTarget
> +Info.plist
> +resourcefile.txt
> +::

This can be written like this:

 will produce flat structure for iOS systems::

   ExecutableTarget.app
 appres.txt
 ExecutableTarget
 Info.plist
 resourcefile.txt

> \ No newline at end of file

Please add a trailing newline.

> Please let me know what do you think about that patch implementation.

Good start.  Please also extend the Tests/RunCMake/Framework test 
FrameworkLayout case to cover such resource files.

Thanks,
-Brad



0001-Fix-resource-directory-structure-update-help-and-tes.patch
Description: 0001-Fix-resource-directory-structure-update-help-and-tes.patch
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

[cmake-developers] [CMake 0015864]: CMake can't always find git.exe in PATH element with quotation marks

2015-11-26 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
http://public.kitware.com/Bug/view.php?id=15864 
== 
Reported By:Arthur Klassen
Assigned To:
== 
Project:CMake
Issue ID:   15864
Category:   (No Category)
Reproducibility:sometimes
Severity:   minor
Priority:   normal
Status: new
== 
Date Submitted: 2015-11-26 11:46 EST
Last Modified:  2015-11-26 11:46 EST
== 
Summary:CMake can't always find git.exe in PATH element with
quotation marks
Description: 
My 581-character path includes things in c:\Program Files, some but not all in
quotation marks. The element of the USER variable of PATH pointing to git.exe
had quotation marks around it and sometimes that prevented cmake from finding
it. Removing the quotation marks solved the problem. Their presence does not
invalidate the path as far as cmd.exe is concerned: it found git.exe just fine
either way, so this is an issue, if a minor one, easily worked around.

For a "simple" CMakeLists.txt file this problem never occurred!!?


Steps to Reproduce: 
When my PATH variable contained:

set
PATH=C:\Perl64\site\bin;C:\Perl64\bin;C:\Python27\;C:\Python27\Scripts;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
Files\TortoiseSVN\bin;C:\Program Files (x86)\Windows Kits\8.1\Windows
Performance Toolkit\;C:\Program Files\Microsoft SQL
Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft
SDKs\TypeScript\1.0\;C:\Program Files\Common Files\ThinPrint\;C:\Program
Files\TortoiseGit\bin;e:\me\tools;"c:\Program
Files\Git\cmd\";%APPDATA%\Python\Scripts;C:\Program Files (x86)\CMake\bin

A three-line CMakeLists.txt file like this:

cmake_minimum_required( VERSION 3.1 )

find_package( Git )

message( "Returned value of GIT_EXECUTABLE is ${GIT_EXECUTABLE}" )

was able to find Git but calling find_package( Git ) from a more complex
CMakeLists.txt (that includes other sub-CMakeLists files) failed, even from the
first line of the most top-level CMakeLists.txt file, even when the "message()"
call was followed by a "return()".

This persisted until I removed the quotation marks from the path. This occurred
even if I moved the "git" path to the front of the PATH variable.
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2015-11-26 11:46 Arthur Klassen New Issue
==

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


[cmake-developers] [CMake 0015865]: Can't use /PDBALTPATH:%_PDB% in MSVC IDE generator due to CMake escaping percent signs

2015-11-26 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
https://cmake.org/Bug/view.php?id=15865 
== 
Reported By:temp4746
Assigned To:
== 
Project:CMake
Issue ID:   15865
Category:   CMake
Reproducibility:always
Severity:   major
Priority:   normal
Status: new
== 
Date Submitted: 2015-11-26 14:11 EST
Last Modified:  2015-11-26 14:11 EST
== 
Summary:Can't use /PDBALTPATH:%_PDB% in MSVC IDE generator
due to CMake escaping percent signs
Description: 
When using the MSVC generator and using a linker flag that is added to the
AdditionalOptions of the linker in the vcxproj, CMake will escape the linker
flag.

For example it will double up percent signs in a flag such as:

/PDBALTPATH:%_PDB%

Resuling in:

/PDBALTPATH:%%_PDB%%

Which is wrong in the MSVC IDE but might be correct for makefile generators.
This prevents using this flag properly.

Any fix for this need to be carefully thought out to prevent introducing an
escaping bug in a different location in CMake.

BTW if you try using percent signs in a compiler option it will escape it TWICE
meaning you get FOUR percent signs for one percent sign.

Steps to Reproduce: 
Try the following:

cmake_minimum_required(VERSION 3.4)
project(Bug)
add_executable(bug main.cpp)
set_target_properties(bug PROPERTIES LINK_FLAGS "/PDBALTPATH:%_PDB%")

And look in the IDE under linker->Command Line
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2015-11-26 14:11 temp4746   New Issue
==

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


[cmake-developers] Get the list of files that will be installed by CMake?

2015-11-26 Thread Robert Goulet
Hi all,

Is there a way in CMake to get the list of files that are going to be installed 
when we use the install command? Some kind of CMAKE_INSTALL_FILES_LIST or 
something like that? We would need to get that list of files so we can add them 
as "Content" to our Windows 10 UWP project (otherwise they are not part of the 
deployment).

Thanks!
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

[cmake-developers] [PATCH] Add NIOS2 CPU support

2015-11-26 Thread Marek Vasut
Add necessary bits to support the NIOS2 little-endian CPU.

Signed-off-by: Marek Vasut 
Cc: Ley Foon Tan 
Cc: Thomas Chou 
Cc: Walter Goossens 
---
 Source/kwsys/CPU.h.in| 4 
 Utilities/KWIML/ABI.h.in | 4 
 2 files changed, 8 insertions(+)

diff --git a/Source/kwsys/CPU.h.in b/Source/kwsys/CPU.h.in
index 884d71a..66ffbb1 100644
--- a/Source/kwsys/CPU.h.in
+++ b/Source/kwsys/CPU.h.in
@@ -88,6 +88,10 @@
 #elif defined(__mips) || defined(__mips__) || defined(__MIPS__)
 # define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG
 
+/* NIOS2 */
+#elif defined(__NIOS2__) || defined(__NIOS2) || defined(__nios2__)
+# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE
+
 /* OpenRISC 1000 */
 #elif defined(__or1k__)
 # define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG
diff --git a/Utilities/KWIML/ABI.h.in b/Utilities/KWIML/ABI.h.in
index 6300ada..87b6e96 100644
--- a/Utilities/KWIML/ABI.h.in
+++ b/Utilities/KWIML/ABI.h.in
@@ -398,6 +398,10 @@ suppression macro @KWIML@_ABI_NO_VERIFY was defined.
 #elif defined(__mips) || defined(__mips__) || defined(__MIPS__)
 # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG
 
+/* NIOS2 */
+#elif defined(__NIOS2__) || defined(__NIOS2) || defined(__nios2__)
+# define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_LITTLE
+
 /* OpenRISC 1000 */
 #elif defined(__or1k__)
 # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG
-- 
2.6.2

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


Re: [cmake-developers] Get the list of files that will be installed by CMake?

2015-11-26 Thread J Decker
building the list of things to install and then using that list... the
other way no.


On Thu, Nov 26, 2015 at 11:33 AM, Robert Goulet
 wrote:
> Hi all,
>
>
>
> Is there a way in CMake to get the list of files that are going to be
> installed when we use the install command? Some kind of
> CMAKE_INSTALL_FILES_LIST or something like that? We would need to get that
> list of files so we can add them as “Content” to our Windows 10 UWP project
> (otherwise they are not part of the deployment).
>
>
>
> Thanks!
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake-developers
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers