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  93b7164a34f40d60dbfd625d0aa90b55304ed34f (commit)
       via  36f7cbca985894fb03e4a395a110869cf67378a5 (commit)
      from  8e5b1aa579c1ec68fd428ef29eecd9723812c3ed (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=93b7164a34f40d60dbfd625d0aa90b55304ed34f
commit 93b7164a34f40d60dbfd625d0aa90b55304ed34f
Merge: 8e5b1aa 36f7cbc
Author:     Clinton Stimpson <clin...@elemtech.com>
AuthorDate: Thu Mar 26 00:55:51 2015 -0400
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Thu Mar 26 00:55:51 2015 -0400

    Merge topic 'cpack-archive-prefix' into next
    
    36f7cbca cpack: Fix handling of CPACK_PACKAGING_INSTALL_PREFIX for archives.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=36f7cbca985894fb03e4a395a110869cf67378a5
commit 36f7cbca985894fb03e4a395a110869cf67378a5
Author:     Clinton Stimpson <clin...@elemtech.com>
AuthorDate: Wed Mar 25 22:36:38 2015 -0600
Commit:     Clinton Stimpson <clin...@elemtech.com>
CommitDate: Wed Mar 25 22:48:47 2015 -0600

    cpack: Fix handling of CPACK_PACKAGING_INSTALL_PREFIX for archives.
    
    Fixes bug #14677 where the archive generator is used to package
    components with an install prefix.

diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx 
b/Source/CPack/cmCPackArchiveGenerator.cxx
index e2437b5..373170b 100644
--- a/Source/CPack/cmCPackArchiveGenerator.cxx
+++ b/Source/CPack/cmCPackArchiveGenerator.cxx
@@ -63,6 +63,13 @@ int 
cmCPackArchiveGenerator::addOneComponentToArchive(cmArchiveWrite& archive,
     filePrefix = this->GetOption("CPACK_PACKAGE_FILE_NAME");
     filePrefix += "/";
     }
+  const char* installPrefix = 
this->GetOption("CPACK_PACKAGING_INSTALL_PREFIX");
+  if(installPrefix && installPrefix[0] == '/')
+    {
+    // add to file prefix and remove the leading '/'
+    filePrefix += installPrefix+1;
+    filePrefix += "/";
+    }
   std::vector<std::string>::const_iterator fileIt;
   for (fileIt = component->Files.begin(); fileIt != component->Files.end();
        ++fileIt )
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 41032f8..7135f5d 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -862,6 +862,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P 
${CMake_SOURCE_DIR}/Utilities/Release
   set(CTEST_RUN_CPackComponents ${CTEST_TEST_CPACK})
   set(CTEST_package_X11_TEST ${CTEST_TEST_CPACK})
   set(CTEST_RUN_CPackComponentsForAll ${CTEST_TEST_CPACK})
+  set(CTEST_RUN_CPackComponentsPrefix ${CTEST_TEST_CPACK})
 
   # Do not try to build RPM
   if (NOT RPMBUILD_EXECUTABLE)
@@ -1035,6 +1036,32 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P 
${CMake_SOURCE_DIR}/Utilities/Release
     list(APPEND TEST_BUILD_DIRS 
"${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators")
   endif()
 
+  if(CTEST_RUN_CPackComponentsPrefix)
+    set(CPackComponents_BUILD_OPTIONS)
+    if(APPLE)
+      set(CPackComponents_BUILD_OPTIONS -DCPACK_BINARY_DRAGNDROP:BOOL=ON)
+    endif()
+    if(NSIS_MAKENSIS_EXECUTABLE)
+      set(CPackComponents_BUILD_OPTIONS ${CPackComponents_BUILD_OPTIONS}
+        -DCPACK_BINARY_NSIS:BOOL=ON)
+    endif()
+
+    add_test(CPackComponentsPrefix ${CMAKE_CTEST_COMMAND}
+      --build-and-test
+      "${CMake_SOURCE_DIR}/Tests/CPackComponentsPrefix"
+      "${CMake_BINARY_DIR}/Tests/CPackComponentsPrefix"
+      ${build_generator_args}
+      --build-project CPackComponentsPrefix
+      --build-two-config
+      --build-target package
+      --build-options ${build_options}
+        -DCPACK_BINARY_DEB:BOOL=${CPACK_BINARY_DEB}
+        -DCPACK_BINARY_RPM:BOOL=${CPACK_BINARY_RPM}
+        ${CPackComponents_BUILD_OPTIONS}
+        )
+    list(APPEND TEST_BUILD_DIRS 
"${CMake_BINARY_DIR}/Tests/CPackComponentsPrefix")
+  endif()
+
   if(CTEST_package_X11_TEST)
     set(X11_build_target_arg --build-target package)
   else()
diff --git a/Tests/CPackComponentsPrefix/CMakeLists.txt 
b/Tests/CPackComponentsPrefix/CMakeLists.txt
new file mode 100644
index 0000000..207dae8
--- /dev/null
+++ b/Tests/CPackComponentsPrefix/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 3.2)
+project(CPackComponentsPrefix NONE)
+
+install(FILES file-runtime.txt
+        DESTINATION bin COMPONENT Runtime)
+install(FILES file-development.txt
+        DESTINATION lib COMPONENT Development)
+
+set(CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY 1)
+set(CPACK_COMPONENTS_ALL Development)
+set(CPACK_ARCHIVE_COMPONENT_INSTALL 1)
+set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/My-1.0")
+include(CPack)
diff --git a/Tests/CPackComponentsPrefix/file-development.txt 
b/Tests/CPackComponentsPrefix/file-development.txt
new file mode 100644
index 0000000..df22d2f
--- /dev/null
+++ b/Tests/CPackComponentsPrefix/file-development.txt
@@ -0,0 +1 @@
+This file is installed with the Development component.
diff --git a/Tests/CPackComponentsPrefix/file-runtime.txt 
b/Tests/CPackComponentsPrefix/file-runtime.txt
new file mode 100644
index 0000000..135c13d
--- /dev/null
+++ b/Tests/CPackComponentsPrefix/file-runtime.txt
@@ -0,0 +1 @@
+This file is installed with the Runtime component.

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

Summary of changes:
 Source/CPack/cmCPackArchiveGenerator.cxx         |    7 ++++++
 Tests/CMakeLists.txt                             |   27 ++++++++++++++++++++++
 Tests/CPackComponentsPrefix/CMakeLists.txt       |   13 +++++++++++
 Tests/CPackComponentsPrefix/file-development.txt |    1 +
 Tests/CPackComponentsPrefix/file-runtime.txt     |    1 +
 5 files changed, 49 insertions(+)
 create mode 100644 Tests/CPackComponentsPrefix/CMakeLists.txt
 create mode 100644 Tests/CPackComponentsPrefix/file-development.txt
 create mode 100644 Tests/CPackComponentsPrefix/file-runtime.txt


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits

Reply via email to