[Cmake-commits] CMake branch, next, updated. v3.2.2-2418-g656579f

Domen Vrankar domen.vrankar at gmail.com
Sat May 2 16:17:49 EDT 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  656579f48975716f16aff00772be4d2ef96a9741 (commit)
       via  04f4284837abbcb346ae619dff1b2da3975ea875 (commit)
       via  22a707e861adb1c771d2c12aacdbaf1b8d3b86ec (commit)
      from  6c49c290da32c1ff7f66ad84ca723ca0bcfe6217 (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 -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=656579f48975716f16aff00772be4d2ef96a9741
commit 656579f48975716f16aff00772be4d2ef96a9741
Merge: 6c49c29 04f4284
Author:     Domen Vrankar <domen.vrankar at gmail.com>
AuthorDate: Sat May 2 16:17:48 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat May 2 16:17:48 2015 -0400

    Merge topic 'cpack-deb-component-auto-discovery' into next
    
    04f42848 CPack/DEB component dependency auto-discovery
    22a707e8 CMake Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=04f4284837abbcb346ae619dff1b2da3975ea875
commit 04f4284837abbcb346ae619dff1b2da3975ea875
Author:     Raffi Enficiaud <raffi.enficiaud at mines-paris.org>
AuthorDate: Sat May 2 22:14:57 2015 +0200
Commit:     Domen Vrankar <domen.vrankar at gmail.com>
CommitDate: Sat May 2 22:14:57 2015 +0200

    CPack/DEB component dependency auto-discovery
    
    Dependency auto-discovery can now be set per component

diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake
index 24452a6..69bb302 100644
--- a/Modules/CPackDeb.cmake
+++ b/Modules/CPackDeb.cmake
@@ -103,16 +103,23 @@
 #  characters such as <>.
 #
 # .. variable:: CPACK_DEBIAN_PACKAGE_SHLIBDEPS
-#
-#  * Mandatory : NO
-#  * Default   : OFF
+#               CPACK_DEBIAN_<COMPONENT>_PACKAGE_SHLIBDEPS
 #
 #  May be set to ON in order to use dpkg-shlibdeps to generate
 #  better package dependency list.
-#  You may need set CMAKE_INSTALL_RPATH toi appropriate value
-#  if you use this feature, because if you don't dpkg-shlibdeps
-#  may fail to find your own shared libs.
-#  See http://www.cmake.org/Wiki/CMake_RPATH_handling.
+#
+#  * Mandatory : NO
+#  * Default   :
+#
+#    - :variable:`CPACK_DEBIAN_PACKAGE_SHLIBDEPS` if set or
+#    - OFF
+#
+#  .. note::
+#
+#    You may need set :variable:`CMAKE_INSTALL_RPATH` to an appropriate value
+#    if you use this feature, because if you don't :code:`dpkg-shlibdeps`
+#    may fail to find your own shared libs.
+#    See http://www.cmake.org/Wiki/CMake_RPATH_handling.
 #
 # .. variable:: CPACK_DEBIAN_PACKAGE_DEBUG
 #
@@ -245,6 +252,21 @@ function(cpack_deb_prepare_package_vars)
     set(CPACK_DEBIAN_FAKEROOT_EXECUTABLE ${FAKEROOT_EXECUTABLE})
   endif()
 
+  # per component automatic discover: some of the component might not have
+  # binaries.
+  if(CPACK_DEB_PACKAGE_COMPONENT)
+    string(TOUPPER "${CPACK_DEB_PACKAGE_COMPONENT}" _local_component_name)
+    set(_component_shlibdeps_var "CPACK_DEBIAN_${_local_component_name}_PACKAGE_SHLIBDEPS")
+
+    # if set, overrides the global configuration
+    if(DEFINED ${_component_shlibdeps_var})
+      set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS "${${_component_shlibdeps_var}}")
+      if(CPACK_DEBIAN_PACKAGE_DEBUG)
+        message("CPackDeb Debug: component '${CPACK_DEB_PACKAGE_COMPONENT}' dpkg-shlibdeps set to ${CPACK_DEBIAN_PACKAGE_SHLIBDEPS}")
+      endif()
+    endif()
+  endif()
+
   if(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
     # dpkg-shlibdeps is a Debian utility for generating dependency list
     find_program(SHLIBDEPS_EXECUTABLE dpkg-shlibdeps)
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 07545ae..35326a5 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1010,7 +1010,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
       set(DEB_TEST_NAMES "CPackComponentsDEB")
       set(DEB_CONFIGURATIONS_TO_TEST "components-lintian-dpkgdeb-checks"
                                      "components-description1"
-                                     "components-description2")
+                                     "components-description2"
+                                     "components-shlibdeps1")
       set(CPackGen "DEB")
       set(CPackRun_CPackGen "-DCPackGen=${CPackGen}")
 
diff --git a/Tests/CPackComponentsDEB/MyLibCPackConfig-components-shlibdeps1.cmake.in b/Tests/CPackComponentsDEB/MyLibCPackConfig-components-shlibdeps1.cmake.in
new file mode 100644
index 0000000..cfe6df5
--- /dev/null
+++ b/Tests/CPackComponentsDEB/MyLibCPackConfig-components-shlibdeps1.cmake.in
@@ -0,0 +1,24 @@
+#
+# Activate component packaging
+#
+
+if(CPACK_GENERATOR MATCHES "DEB")
+   set(CPACK_DEB_COMPONENT_INSTALL "ON")
+endif()
+
+#
+# Choose grouping way
+#
+#set(CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE)
+#set(CPACK_COMPONENTS_GROUPING)
+set(CPACK_COMPONENTS_IGNORE_GROUPS 1)
+#set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1)
+
+# we set shlibdeps to on
+set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
+# except for the component "headers" that do not contain any binary.
+# the packaging will just fail if this does not work
+set(CPACK_DEBIAN_HEADERS_PACKAGE_SHLIBDEPS OFF)
+
+# Also libraries contains only a static library.
+set(CPACK_DEBIAN_LIBRARIES_PACKAGE_SHLIBDEPS OFF)
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake
new file mode 100644
index 0000000..4aff0eb
--- /dev/null
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake
@@ -0,0 +1,74 @@
+if(NOT CPackComponentsDEB_SOURCE_DIR)
+  message(FATAL_ERROR "CPackComponentsDEB_SOURCE_DIR not set")
+endif()
+
+include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
+
+
+
+# requirements
+
+# debian now produces lower case names
+set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/MyLib-*.deb")
+set(expected_count 3)
+
+
+set(actual_output)
+run_cpack(actual_output
+          CPack_output
+          CPack_error
+          EXPECTED_FILE_MASK "${expected_file_mask}"
+          CONFIG_ARGS ${config_args}
+          CONFIG_VERBOSE ${config_verbose})
+
+message(STATUS "expected_count='${expected_count}'")
+message(STATUS "expected_file_mask='${expected_file_mask}'")
+message(STATUS "actual_output_files='${actual_output}'")
+
+if(NOT actual_output)
+  message(FATAL_ERROR "error: expected_files do not exist: CPackComponentsDEB test fails. (CPack_output=${CPack_output}, CPack_error=${CPack_error}")
+endif()
+
+list(LENGTH actual_output actual_count)
+message(STATUS "actual_count='${actual_count}'")
+if(NOT actual_count EQUAL expected_count)
+  message(FATAL_ERROR "error: expected_count=${expected_count} does not match actual_count=${actual_count}: CPackComponents test fails. (CPack_output=${CPack_output}, CPack_error=${CPack_error})")
+endif()
+
+
+# dpkg-deb checks for the summary of the packages
+if(DPKGDEB_EXECUTABLE)
+  set(dpkgdeb_output_errors_all)
+  foreach(_f IN LISTS actual_output)
+
+    # extracts the metadata from the package
+    run_dpkgdeb(dpkg_output
+                FILENAME ${_f}
+                )
+
+    dpkgdeb_return_specific_metaentry(dpkg_package_name
+                                      DPKGDEB_OUTPUT "${dpkg_output}"
+                                      METAENTRY "Package:")
+
+    message(STATUS "package='${dpkg_package_name}'")
+
+    if("${dpkg_package_name}" STREQUAL "mylib-applications")
+      # pass
+    elseif("${dpkg_package_name}" STREQUAL "mylib-headers")
+      # pass
+    elseif("${dpkg_package_name}" STREQUAL "mylib-libraries")
+      # pass
+    else()
+      set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
+                                    "dpkg-deb: ${_f}: component name not found: ${dpkg_package_name}\n")
+    endif()
+
+  endforeach()
+
+
+  if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
+    message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
+  endif()
+else()
+  message("dpkg-deb executable not found - skipping dpkg-deb test")
+endif()

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

Summary of changes:
 Modules/CPackDeb.cmake                             |   36 ++++++++++++++++----
 Source/CMakeVersion.cmake                          |    2 +-
 Tests/CMakeLists.txt                               |    3 +-
 ...MyLibCPackConfig-components-shlibdeps1.cmake.in |   24 +++++++++++++
 ...nCPackVerifyResult-components-shlibdeps1.cmake} |   35 +++++++------------
 5 files changed, 68 insertions(+), 32 deletions(-)
 create mode 100644 Tests/CPackComponentsDEB/MyLibCPackConfig-components-shlibdeps1.cmake.in
 copy Tests/CPackComponentsDEB/{RunCPackVerifyResult-components-description2.cmake => RunCPackVerifyResult-components-shlibdeps1.cmake} (58%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list