[Cmake-commits] CMake branch, master, updated. v3.8.1-1231-gbc7d64f

Kitware Robot kwrobot at kitware.com
Thu May 18 09:05:03 EDT 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, master has been updated
       via  bc7d64f896d6e180970cb404cc7699732db34adc (commit)
       via  44f8f839cbdddcb756bdb561b0905933e7551867 (commit)
       via  9e24af01375d370ae84c40a95501aa5a33d3fe97 (commit)
       via  9e06e97d30faf0916bec404c81922334139cf177 (commit)
      from  10371cd6dcfc1bf601fa3e715734dbe66199e2e4 (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=bc7d64f896d6e180970cb404cc7699732db34adc
commit bc7d64f896d6e180970cb404cc7699732db34adc
Merge: 44f8f83 9e24af0
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu May 18 13:03:34 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu May 18 09:03:40 2017 -0400

    Merge topic 'string-append'
    
    9e24af01 Use string(APPEND) in Modules
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !864


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=44f8f839cbdddcb756bdb561b0905933e7551867
commit 44f8f839cbdddcb756bdb561b0905933e7551867
Merge: 10371cd 9e06e97
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu May 18 13:01:53 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu May 18 09:01:57 2017 -0400

    Merge topic 'cpack-archive-per-component-filename'
    
    9e06e97d CPack/Archive: per component filenames support
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !859


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9e24af01375d370ae84c40a95501aa5a33d3fe97
commit 9e24af01375d370ae84c40a95501aa5a33d3fe97
Author:     Daniel Pfeifer <daniel at pfeifer-mail.de>
AuthorDate: Wed May 17 11:23:34 2017 -0600
Commit:     Daniel Pfeifer <daniel at pfeifer-mail.de>
CommitDate: Wed May 17 11:26:11 2017 -0600

    Use string(APPEND) in Modules
    
    Automate with:
    
    find Modules -type f -print0 | xargs -0 perl -i -0pe \
      's/set\(([a-zA-Z0-9_\$\{\}]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'

diff --git a/Modules/CMakeCompilerIdDetection.cmake b/Modules/CMakeCompilerIdDetection.cmake
index 7ca79bd..f2d43b6 100644
--- a/Modules/CMakeCompilerIdDetection.cmake
+++ b/Modules/CMakeCompilerIdDetection.cmake
@@ -95,13 +95,13 @@ function(compiler_id_detection outvar lang)
 
     if(CID_ID_DEFINE)
       foreach(Id ${ordered_compilers})
-        set(CMAKE_${lang}_COMPILER_ID_CONTENT "${CMAKE_${lang}_COMPILER_ID_CONTENT}# define ${CID_PREFIX}COMPILER_IS_${Id} 0\n")
+        string(APPEND CMAKE_${lang}_COMPILER_ID_CONTENT "# define ${CID_PREFIX}COMPILER_IS_${Id} 0\n")
       endforeach()
     endif()
 
     set(pp_if "#if")
     if (CID_VERSION_STRINGS)
-      set(CMAKE_${lang}_COMPILER_ID_CONTENT "${CMAKE_${lang}_COMPILER_ID_CONTENT}\n/* Version number components: V=Version, R=Revision, P=Patch
+      string(APPEND CMAKE_${lang}_COMPILER_ID_CONTENT "\n/* Version number components: V=Version, R=Revision, P=Patch
    Version date components:   YYYY=Year, MM=Month,   DD=Day  */\n")
     endif()
 
@@ -126,7 +126,7 @@ function(compiler_id_detection outvar lang)
         string(CONFIGURE "${_compiler_id_version_compute_${Id}}" VERSION_BLOCK @ONLY)
         string(APPEND id_content "${VERSION_BLOCK}\n")
       endif()
-      set(CMAKE_${lang}_COMPILER_ID_CONTENT "${CMAKE_${lang}_COMPILER_ID_CONTENT}\n${id_content}")
+      string(APPEND CMAKE_${lang}_COMPILER_ID_CONTENT "\n${id_content}")
       set(pp_if "#elif")
     endforeach()
 
@@ -145,7 +145,7 @@ function(compiler_id_detection outvar lang)
 # define ${CID_PREFIX}COMPILER_ID \"\"")
     endif()
 
-    set(CMAKE_${lang}_COMPILER_ID_CONTENT "${CMAKE_${lang}_COMPILER_ID_CONTENT}\n${platform_compiler_detection}\n#endif")
+    string(APPEND CMAKE_${lang}_COMPILER_ID_CONTENT "\n${platform_compiler_detection}\n#endif")
   endif()
 
   set(${outvar} ${CMAKE_${lang}_COMPILER_ID_CONTENT} PARENT_SCOPE)
diff --git a/Modules/CPackComponent.cmake b/Modules/CPackComponent.cmake
index 2adc9b9..3a10b99 100644
--- a/Modules/CPackComponent.cmake
+++ b/Modules/CPackComponent.cmake
@@ -309,11 +309,11 @@ set(CPackComponent_CMake_INCLUDED 1)
 # configuration file.
 macro(cpack_append_variable_set_command var strvar)
   if (DEFINED ${var})
-    set(${strvar} "${${strvar}}set(${var}")
+    string(APPEND ${strvar} "set(${var}")
     foreach(APPENDVAL ${${var}})
-      set(${strvar} "${${strvar}} ${APPENDVAL}")
+      string(APPEND ${strvar} " ${APPENDVAL}")
     endforeach()
-    set(${strvar} "${${strvar}})\n")
+    string(APPEND ${strvar} ")\n")
   endif ()
 endmacro()
 
@@ -325,7 +325,7 @@ macro(cpack_append_string_variable_set_command var strvar)
   if (DEFINED ${var})
     list(LENGTH ${var} CPACK_APP_VALUE_LEN)
     if(${CPACK_APP_VALUE_LEN} EQUAL 1)
-      set(${strvar} "${${strvar}}set(${var} \"${${var}}\")\n")
+      string(APPEND ${strvar} "set(${var} \"${${var}}\")\n")
     endif()
   endif ()
 endmacro()
@@ -352,7 +352,7 @@ macro(cpack_append_option_set_command var strvar)
   if (${var})
     list(LENGTH ${var} CPACK_APP_VALUE_LEN)
     if(${CPACK_APP_VALUE_LEN} EQUAL 1)
-      set(${strvar} "${${strvar}}set(${var} TRUE)\n")
+      string(APPEND ${strvar} "set(${var} TRUE)\n")
     endif()
   endif ()
 endmacro()
diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake
index 4b3e223..fcf1df7 100644
--- a/Modules/CheckTypeSize.cmake
+++ b/Modules/CheckTypeSize.cmake
@@ -247,10 +247,10 @@ macro(CHECK_TYPE_SIZE TYPE VARIABLE)
     set(${VARIABLE}_CODE)
     set(_if if)
     foreach(key ${${VARIABLE}_KEYS})
-      set(${VARIABLE}_CODE "${${VARIABLE}_CODE}#${_if} defined(${key})\n# define ${VARIABLE} ${${VARIABLE}-${key}}\n")
+      string(APPEND ${VARIABLE}_CODE "#${_if} defined(${key})\n# define ${VARIABLE} ${${VARIABLE}-${key}}\n")
       set(_if elif)
     endforeach()
-    set(${VARIABLE}_CODE "${${VARIABLE}_CODE}#else\n# error ${VARIABLE} unknown\n#endif")
+    string(APPEND ${VARIABLE}_CODE "#else\n# error ${VARIABLE} unknown\n#endif")
     set(_if)
   elseif(${VARIABLE})
     set(${VARIABLE}_CODE "#define ${VARIABLE} ${${VARIABLE}}")
diff --git a/Modules/ExternalData.cmake b/Modules/ExternalData.cmake
index 873f88d..7331fb2 100644
--- a/Modules/ExternalData.cmake
+++ b/Modules/ExternalData.cmake
@@ -1111,7 +1111,7 @@ if("${ExternalData_ACTION}" STREQUAL "fetch")
       list(GET algo_list ${ii} algo)
       _ExternalData_download_object("${name}" "${hash}" "${algo}"
         obj succeeded algoErrorMsg)
-      set(errorMsg "${errorMsg}\n${algoErrorMsg}")
+      string(APPEND errorMsg "\n${algoErrorMsg}")
       if(succeeded)
         break()
       endif()
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index b812845..2495736 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -415,7 +415,7 @@ file(STRINGS "${CMAKE_CURRENT_LIST_FILE}" lines
 foreach(line IN LISTS lines)
   if("${line}" MATCHES "^\\.\\. command:: ([A-Za-z0-9_]+)")
     if(_ep_func)
-      set(_ep_keywords_${_ep_func} "${_ep_keywords_${_ep_func}})$")
+      string(APPEND _ep_keywords_${_ep_func} ")$")
     endif()
     set(_ep_func "${CMAKE_MATCH_1}")
     #message("function [${_ep_func}]")
@@ -424,13 +424,13 @@ foreach(line IN LISTS lines)
   elseif("${line}" MATCHES "^  ``([A-Z0-9_]+) .*``$")
     set(_ep_key "${CMAKE_MATCH_1}")
     #message("  keyword [${_ep_key}]")
-    set(_ep_keywords_${_ep_func}
-      "${_ep_keywords_${_ep_func}}${_ep_keyword_sep}${_ep_key}")
+    string(APPEND _ep_keywords_${_ep_func}
+      "${_ep_keyword_sep}${_ep_key}")
     set(_ep_keyword_sep "|")
   endif()
 endforeach()
 if(_ep_func)
-  set(_ep_keywords_${_ep_func} "${_ep_keywords_${_ep_func}})$")
+  string(APPEND _ep_keywords_${_ep_func} ")$")
 endif()
 
 # Save regex matching supported hash algorithm names.
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index e323430..a4dca54 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -1825,7 +1825,7 @@ macro(cuda_compile_base cuda_target format generated_files)
   else()
     set(_counter 1)
   endif()
-  set(_cuda_target "${_cuda_target}_${_counter}")
+  string(APPEND _cuda_target "_${_counter}")
   set_property(DIRECTORY PROPERTY _cuda_internal_phony_counter ${_counter})
 
   # Separate the sources from the options
diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake
index 503d955..af83fb7 100644
--- a/Modules/FindOpenGL.cmake
+++ b/Modules/FindOpenGL.cmake
@@ -178,7 +178,7 @@ if(OPENGL_FOUND)
       if(OPENGL_gl_LIBRARY MATCHES "/([^/]+)\\.framework$")
         set(_gl_fw "${OPENGL_gl_LIBRARY}/${CMAKE_MATCH_1}")
         if(EXISTS "${_gl_fw}.tbd")
-          set(_gl_fw "${_gl_fw}.tbd")
+          string(APPEND _gl_fw ".tbd")
         endif()
         set_target_properties(OpenGL::GL PROPERTIES
           IMPORTED_LOCATION "${_gl_fw}")
@@ -201,7 +201,7 @@ if(OPENGL_FOUND)
       if(OPENGL_glu_LIBRARY MATCHES "/([^/]+)\\.framework$")
         set(_glu_fw "${OPENGL_glu_LIBRARY}/${CMAKE_MATCH_1}")
         if(EXISTS "${_glu_fw}.tbd")
-          set(_glu_fw "${_glu_fw}.tbd")
+          string(APPEND _glu_fw ".tbd")
         endif()
         set_target_properties(OpenGL::GLU PROPERTIES
           IMPORTED_LOCATION "${_glu_fw}")
diff --git a/Modules/Platform/AIX-GNU.cmake b/Modules/Platform/AIX-GNU.cmake
index ca6e97c..7f08c4a 100644
--- a/Modules/Platform/AIX-GNU.cmake
+++ b/Modules/Platform/AIX-GNU.cmake
@@ -19,7 +19,7 @@ string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " -Wl,-brtl")
 macro(__aix_compiler_gnu lang)
   set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-blibpath:")
   set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":")
-  set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS} -Wl,-G,-bnoipath")
+  string(APPEND CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS " -Wl,-G,-bnoipath")
   set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-bexpall")
   set(CMAKE_${lang}_USE_IMPLICIT_LINK_DIRECTORIES_IN_RUNTIME_PATH 1)
 
diff --git a/Modules/Platform/CYGWIN-GNU.cmake b/Modules/Platform/CYGWIN-GNU.cmake
index d08dc81..784c8c6 100644
--- a/Modules/Platform/CYGWIN-GNU.cmake
+++ b/Modules/Platform/CYGWIN-GNU.cmake
@@ -40,7 +40,7 @@ macro(__cygwin_compiler_gnu lang)
 
   set(CMAKE_EXE_EXPORTS_${lang}_FLAG "-Wl,--export-all-symbols")
   # TODO: Is -Wl,--enable-auto-import now always default?
-  set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS} -Wl,--enable-auto-import")
+  string(APPEND CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS " -Wl,--enable-auto-import")
   set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS}")
 
   if(NOT CMAKE_RC_COMPILER_INIT)
diff --git a/Modules/Platform/HP-UX-GNU.cmake b/Modules/Platform/HP-UX-GNU.cmake
index 7ac804b..699c4aa 100644
--- a/Modules/Platform/HP-UX-GNU.cmake
+++ b/Modules/Platform/HP-UX-GNU.cmake
@@ -9,7 +9,7 @@ endif()
 set(__HPUX_COMPILER_GNU 1)
 
 macro(__hpux_compiler_gnu lang)
-  set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS} -Wl,-E,-b,+nodefaultrpath")
+  string(APPEND CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS " -Wl,-E,-b,+nodefaultrpath")
   set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-E")
   set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,+b")
   set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":")
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake
index e4aca6e..cfe6e1c 100644
--- a/Modules/Platform/Windows-MSVC.cmake
+++ b/Modules/Platform/Windows-MSVC.cmake
@@ -152,9 +152,9 @@ if(WINCE)
 
   foreach(lang C CXX)
     if(_MSVC_${lang}_ARCHITECTURE_FAMILY STREQUAL "ARM")
-      set(_PLATFORM_DEFINES_${lang} "${_PLATFORM_DEFINES_${lang}} /D${MSVC_${lang}_ARCHITECTURE_ID}")
+      string(APPEND _PLATFORM_DEFINES_${lang} " /D${MSVC_${lang}_ARCHITECTURE_ID}")
       if(MSVC_${lang}_ARCHITECTURE_ID MATCHES "^ARMV([45])I$")
-        set(_FLAGS_${lang} "${_FLAGS_${lang}} /QRarch${CMAKE_MATCH_1}T")
+        string(APPEND _FLAGS_${lang} " /QRarch${CMAKE_MATCH_1}T")
       endif()
     endif()
   endforeach()
diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake
index 8ae3720..1182875 100644
--- a/Modules/UseJava.cmake
+++ b/Modules/UseJava.cmake
@@ -417,7 +417,7 @@ endfunction ()
 
 function(__java_lcat VAR)
     foreach(_line ${ARGN})
-        set(${VAR} "${${VAR}}${_line}\n")
+        string(APPEND ${VAR} "${_line}\n")
     endforeach()
 
     set(${VAR} "${${VAR}}" PARENT_SCOPE)
diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake
index 362099e..e7f9912 100644
--- a/Modules/WriteCompilerDetectionHeader.cmake
+++ b/Modules/WriteCompilerDetectionHeader.cmake
@@ -447,7 +447,7 @@ function(write_compiler_detection_header
       endif()
 
       if(NOT _WCD_ALLOW_UNKNOWN_COMPILER_VERSIONS)
-        set(${compiler_file_content} "${${compiler_file_content}}
+        string(APPEND ${compiler_file_content} "
 #    if !(${_cmake_oldestSupported_${compiler}})
 #      error Unsupported compiler version
 #    endif\n")
@@ -462,7 +462,7 @@ function(write_compiler_detection_header
         set(MACRO_HEX)
       endif()
       string(CONFIGURE "${_compiler_id_version_compute_${compiler}}" VERSION_BLOCK @ONLY)
-      set(${compiler_file_content} "${${compiler_file_content}}${VERSION_BLOCK}\n")
+      string(APPEND ${compiler_file_content} "${VERSION_BLOCK}\n")
       set(PREFIX)
       set(MACRO_DEC)
       set(MACRO_HEX)
@@ -478,7 +478,7 @@ function(write_compiler_detection_header
           set(_define_item "\n#      define ${prefix_arg}_${feature_PP} 0\n")
           set(_define_item "\n#    if ${_cmake_feature_test_${compiler}_${feature}}\n#      define ${prefix_arg}_${feature_PP} 1\n#    else${_define_item}#    endif\n")
         endif()
-        set(${compiler_file_content} "${${compiler_file_content}}${_define_item}")
+        string(APPEND ${compiler_file_content} "${_define_item}")
       endforeach()
     endforeach()
     if(pp_if STREQUAL "elif")

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9e06e97d30faf0916bec404c81922334139cf177
commit 9e06e97d30faf0916bec404c81922334139cf177
Author:     Domen Vrankar <domen.vrankar at gmail.com>
AuthorDate: Tue May 16 23:52:58 2017 +0200
Commit:     Domen Vrankar <domen.vrankar at gmail.com>
CommitDate: Wed May 17 00:47:15 2017 +0200

    CPack/Archive: per component filenames support
    
    Support for setting archive packager specific
    per component filenames and monolithic package
    filenames.

diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst
index 1e8342c..4a03b7a 100644
--- a/Help/manual/cmake-modules.7.rst
+++ b/Help/manual/cmake-modules.7.rst
@@ -54,6 +54,7 @@ All Modules
    /module/CMakePrintSystemInformation
    /module/CMakePushCheckState
    /module/CMakeVerifyManifest
+   /module/CPackArchive
    /module/CPackBundle
    /module/CPackComponent
    /module/CPackCygwin
diff --git a/Help/module/CPackArchive.rst b/Help/module/CPackArchive.rst
new file mode 100644
index 0000000..eb8d9d2
--- /dev/null
+++ b/Help/module/CPackArchive.rst
@@ -0,0 +1 @@
+.. cmake-module:: ../../Modules/CPackArchive.cmake
diff --git a/Help/release/dev/cpack-archive-per-component-filename.rst b/Help/release/dev/cpack-archive-per-component-filename.rst
new file mode 100644
index 0000000..a7a413f
--- /dev/null
+++ b/Help/release/dev/cpack-archive-per-component-filename.rst
@@ -0,0 +1,6 @@
+cpack-rpm-debuginfo-honor-package-filename
+------------------------------------------
+
+* The :module:`CPackArchive` module learned to modify filename per component.
+  See :variable:`CPACK_ARCHIVE_FILE_NAME` variable and its per component
+  version.
diff --git a/Modules/CPackArchive.cmake b/Modules/CPackArchive.cmake
new file mode 100644
index 0000000..741fb1f
--- /dev/null
+++ b/Modules/CPackArchive.cmake
@@ -0,0 +1,39 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#.rst:
+# CPackArchive
+# ------------
+#
+# Archive CPack generator that supports packaging of sources and binaries in
+# different formats:
+#
+#   - 7Z - 7zip - (.7z)
+#   - TBZ2 (.tar.bz2)
+#   - TGZ (.tar.gz)
+#   - TXZ (.tar.xz)
+#   - TZ (.tar.Z)
+#   - ZIP (.zip)
+#
+# Variables specific to CPack Archive generator
+# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+#
+# .. variable:: CPACK_ARCHIVE_FILE_NAME
+#               CPACK_ARCHIVE_<component>_FILE_NAME
+#
+#  Package file name without extension which is added automatically depending
+#  on the archive format.
+#
+#  * Mandatory : YES
+#  * Default   : ``<CPACK_PACKAGE_FILE_NAME>[-<component>].<extension>`` with
+#                spaces replaced by '-'
+#
+# .. variable:: CPACK_ARCHIVE_COMPONENT_INSTALL
+#
+#  Enable component packaging for CPackArchive
+#
+#  * Mandatory : NO
+#  * Default   : OFF
+#
+#  If enabled (ON) multiple packages are generated. By default a single package
+#  containing files of all components is generated.
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx
index cc01b0c..575c949 100644
--- a/Source/CPack/cmCPackArchiveGenerator.cxx
+++ b/Source/CPack/cmCPackArchiveGenerator.cxx
@@ -25,6 +25,28 @@ cmCPackArchiveGenerator::~cmCPackArchiveGenerator()
 {
 }
 
+std::string cmCPackArchiveGenerator::GetArchiveComponentFileName(
+  const std::string& component, bool isGroupName)
+{
+  std::string componentUpper(cmSystemTools::UpperCase(component));
+  std::string packageFileName;
+
+  if (this->IsSet("CPACK_ARCHIVE_" + componentUpper + "_FILE_NAME")) {
+    packageFileName +=
+      this->GetOption("CPACK_ARCHIVE_" + componentUpper + "_FILE_NAME");
+  } else if (this->IsSet("CPACK_ARCHIVE_FILE_NAME")) {
+    packageFileName += GetComponentPackageFileName(
+      this->GetOption("CPACK_ARCHIVE_FILE_NAME"), component, isGroupName);
+  } else {
+    packageFileName += GetComponentPackageFileName(
+      this->GetOption("CPACK_PACKAGE_FILE_NAME"), component, isGroupName);
+  }
+
+  packageFileName += this->GetOutputExtension();
+
+  return packageFileName;
+}
+
 int cmCPackArchiveGenerator::InitializeInternal()
 {
   this->SetOptionIfNotSet("CPACK_INCLUDE_TOPLEVEL_DIRECTORY", "1");
@@ -101,11 +123,9 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
       cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Packaging component group: "
                       << compGIt->first << std::endl);
       // Begin the archive for this group
-      std::string packageFileName = std::string(toplevel);
-      packageFileName += "/" +
-        GetComponentPackageFileName(this->GetOption("CPACK_PACKAGE_FILE_NAME"),
-                                    compGIt->first, true) +
-        this->GetOutputExtension();
+      std::string packageFileName = std::string(toplevel) + "/" +
+        this->GetArchiveComponentFileName(compGIt->first, true);
+
       // open a block in order to automatically close archive
       // at the end of the block
       {
@@ -137,10 +157,9 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
         std::string packageFileName = std::string(toplevel);
 
         localToplevel += "/" + compIt->first;
-        packageFileName += "/" + GetComponentPackageFileName(
-                                   this->GetOption("CPACK_PACKAGE_FILE_NAME"),
-                                   compIt->first, false) +
-          this->GetOutputExtension();
+        packageFileName +=
+          "/" + this->GetArchiveComponentFileName(compIt->first, false);
+
         {
           DECLARE_AND_OPEN_ARCHIVE(packageFileName, archive);
           // Add the files of this component to the archive
@@ -161,10 +180,9 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
       std::string packageFileName = std::string(toplevel);
 
       localToplevel += "/" + compIt->first;
-      packageFileName += "/" +
-        GetComponentPackageFileName(this->GetOption("CPACK_PACKAGE_FILE_NAME"),
-                                    compIt->first, false) +
-        this->GetOutputExtension();
+      packageFileName +=
+        "/" + this->GetArchiveComponentFileName(compIt->first, false);
+
       {
         DECLARE_AND_OPEN_ARCHIVE(packageFileName, archive);
         // Add the files of this component to the archive
@@ -182,9 +200,16 @@ int cmCPackArchiveGenerator::PackageComponentsAllInOne()
   // reset the package file names
   packageFileNames.clear();
   packageFileNames.push_back(std::string(toplevel));
-  packageFileNames[0] += "/" +
-    std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME")) +
-    this->GetOutputExtension();
+  packageFileNames[0] += "/";
+
+  if (this->IsSet("CPACK_ARCHIVE_FILE_NAME")) {
+    packageFileNames[0] += this->GetOption("CPACK_ARCHIVE_FILE_NAME");
+  } else {
+    packageFileNames[0] += this->GetOption("CPACK_PACKAGE_FILE_NAME");
+  }
+
+  packageFileNames[0] += this->GetOutputExtension();
+
   cmCPackLogger(cmCPackLog::LOG_VERBOSE,
                 "Packaging all groups in one package..."
                 "(CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE is set)"
diff --git a/Source/CPack/cmCPackArchiveGenerator.h b/Source/CPack/cmCPackArchiveGenerator.h
index 58d67e3..e7116c4 100644
--- a/Source/CPack/cmCPackArchiveGenerator.h
+++ b/Source/CPack/cmCPackArchiveGenerator.h
@@ -34,6 +34,11 @@ public:
   // component support
   bool SupportsComponentInstallation() const CM_OVERRIDE;
 
+private:
+  // get archive component filename
+  std::string GetArchiveComponentFileName(const std::string& component,
+                                          bool isGroupName);
+
 protected:
   int InitializeInternal() CM_OVERRIDE;
   /**
diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake
index 752ce8a..faf151a 100644
--- a/Tests/RunCMake/CPack/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake
@@ -5,7 +5,7 @@ include("${RunCMake_SOURCE_DIR}/CPackTestHelpers.cmake")
 
 # run_cpack_test args: TEST_NAME "GENERATORS" RUN_CMAKE_BUILD_STEP "PACKAGING_TYPES"
 run_cpack_test(CUSTOM_BINARY_SPEC_FILE "RPM" false "MONOLITHIC;COMPONENT")
-run_cpack_test(CUSTOM_NAMES "RPM;DEB" true "COMPONENT")
+run_cpack_test(CUSTOM_NAMES "RPM;DEB;TGZ" true "COMPONENT")
 run_cpack_test(DEBUGINFO "RPM" true "COMPONENT")
 run_cpack_test(DEPENDENCIES "RPM;DEB" true "COMPONENT")
 run_cpack_test(DIST "RPM" false "MONOLITHIC")
diff --git a/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake
index ae5f0af..5cb280c 100644
--- a/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake
+++ b/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake
@@ -9,4 +9,7 @@ set(EXPECTED_FILE_CONTENT_3_LIST "/usr;/usr/foo;/usr/foo/CMakeLists.txt")
 if(GENERATOR_TYPE STREQUAL "DEB" OR GENERATOR_TYPE STREQUAL "RPM")
   string(TOLOWER "${GENERATOR_TYPE}" file_extension_)
   set(EXPECTED_FILE_3 "pkg_3_abc.${file_extension_}")
+elseif(GENERATOR_TYPE STREQUAL "TGZ")
+  set(EXPECTED_FILE_2 "second.tar.gz")
+  set(EXPECTED_FILE_3 "pkg_3_abc.tar.gz")
 endif()
diff --git a/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake b/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake
index 0c2b37b..4c20e41 100644
--- a/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake
+++ b/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake
@@ -7,6 +7,9 @@ if(GENERATOR_TYPE STREQUAL "DEB" OR GENERATOR_TYPE STREQUAL "RPM")
   set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PKG_2_PACKAGE_NAME "second")
   string(TOLOWER "${GENERATOR_TYPE}" file_extension_)
   set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PKG_3_FILE_NAME "pkg_3_abc.${file_extension_}")
+elseif(GENERATOR_TYPE STREQUAL "TGZ")
+  set(CPACK_ARCHIVE_PKG_2_FILE_NAME "second")
+  set(CPACK_ARCHIVE_PKG_3_FILE_NAME "pkg_3_abc")
 endif()
 
 install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_1)

-----------------------------------------------------------------------

Summary of changes:
 Help/manual/cmake-modules.7.rst                    |    1 +
 Help/module/CPackArchive.rst                       |    1 +
 .../dev/cpack-archive-per-component-filename.rst   |    6 +++
 Modules/CMakeCompilerIdDetection.cmake             |    8 +--
 Modules/CPackArchive.cmake                         |   39 ++++++++++++++
 Modules/CPackComponent.cmake                       |   10 ++--
 Modules/CheckTypeSize.cmake                        |    4 +-
 Modules/ExternalData.cmake                         |    2 +-
 Modules/ExternalProject.cmake                      |    8 +--
 Modules/FindCUDA.cmake                             |    2 +-
 Modules/FindOpenGL.cmake                           |    4 +-
 Modules/Platform/AIX-GNU.cmake                     |    2 +-
 Modules/Platform/CYGWIN-GNU.cmake                  |    2 +-
 Modules/Platform/HP-UX-GNU.cmake                   |    2 +-
 Modules/Platform/Windows-MSVC.cmake                |    4 +-
 Modules/UseJava.cmake                              |    2 +-
 Modules/WriteCompilerDetectionHeader.cmake         |    6 +--
 Source/CPack/cmCPackArchiveGenerator.cxx           |   57 ++++++++++++++------
 Source/CPack/cmCPackArchiveGenerator.h             |    5 ++
 Tests/RunCMake/CPack/RunCMakeTest.cmake            |    2 +-
 .../CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake   |    3 ++
 Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake |    3 ++
 22 files changed, 128 insertions(+), 45 deletions(-)
 create mode 100644 Help/module/CPackArchive.rst
 create mode 100644 Help/release/dev/cpack-archive-per-component-filename.rst
 create mode 100644 Modules/CPackArchive.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list