Commit 71f61636 authored by David Cole's avatar David Cole

ENH: One more patch from Doug Gregor including PackageMaker functionality for...

ENH: One more patch from Doug Gregor including PackageMaker functionality for componentized-for-the-end-user and download-some-bit-on-demand installers.
parent 3366e6c2
......@@ -32,6 +32,6 @@
<key>IFPkgFormatVersion</key>
<real>0.10000000149011612</real>
<key>CFBundleIdentifier</key>
<string>com.@CPACK_PACKAGE_VENDOR@.@CPACK_PACKAGE_NAME@.@CPACK_PACKAGE_VERSION@@CPACK_MODULE_VERSION_SUFFIX@</string>
<string>com.@CPACK_PACKAGE_VENDOR@.@CPACK_PACKAGE_NAME@@CPACK_MODULE_VERSION_SUFFIX@</string>
</dict>
</plist>
......@@ -107,7 +107,7 @@
# that won't be packaged when building a source package. This is a
# list of patterns, e.g., /CVS/;/\\.svn/;\\.swp$;\\.#;/#;.*~;cscope.*
#
# The following variables are specific to the graphical installers build
# The following variables are specific to the graphical installers built
# on Windows using the Nullsoft Installation System.
#
# CPACK_PACKAGE_INSTALL_REGISTRY_KEY - Registry key used when
......@@ -157,6 +157,22 @@
# CPACK_NSIS_DELETE_ICONS_EXTRA -Additional NSIS commands to
# uninstall start menu shortcuts.
#
# The following variable is specific to installers build on Mac OS X
# using PackageMaker:
#
# CPACK_OSX_PACKAGE_VERSION - The version of Mac OS X that the
# resulting PackageMaker archive should be compatible
# with. Different versions of Mac OS X support different
# features. For example, CPack can only build component-based
# installers for Mac OS X 10.4 or newer, and can only build
# installers that download component son-the-fly for Mac OS X 10.5
# or newer. If left blank, this value will be set to the minimum
# version of Mac OS X that supports the requested features. Set this
# variable to some value (e.g., 10.4) only if you want to guarantee
# that your installer will work on that version of Mac OS X, and
# don't mind missing extra features available in the installer
# shipping with later versions of Mac OS X.
#
# The following variables are for advanced uses of CPack:
#
# CPACK_CMAKE_GENERATOR - What CMake generator should be used if the
......@@ -251,9 +267,9 @@
# installer itself. For more information, see the cpack_configure_downloads
# command.
#
# ARCHIVE_FILE provides a name for the ZIP file created by CPack to
# be used for downloaded components. If not supplied, CPack will
# create ZIP file with some name based on CPACK_PACKAGE_FILE_NAME and
# ARCHIVE_FILE provides a name for the archive file created by CPack
# to be used for downloaded components. If not supplied, CPack will
# create a file with some name based on CPACK_PACKAGE_FILE_NAME and
# the name of the component. See cpack_configure_downloads for more
# information.
#
......@@ -330,30 +346,34 @@
#
# The cpack_configure_downloads command configures installation-time
# downloads of selected components. For each downloadable component,
# CPack will create a ZIP file containing the contents of that component,
# which should be uploaded to the given site. When the user selects that
# component for installation, the installer will download and extract
# the component in place. This feature is useful for creating small
# installers that only download the requested components, saving
# bandwidth. Additionally, the installers are small enough that they
# will be installed as part of the normal installation process, and the
# "Change" button in Windows Add/Remove Programs control panel will
# allow one to add or remove parts of the application after the original
# installation. The downloaded-components functionality is currently
# only available with the NSIS generator on Windows. It requires the
# ZipDLL plug-in for NSIS, available at:
# CPack will create an archive containing the contents of that
# component, which should be uploaded to the given site. When the
# user selects that component for installation, the installer will
# download and extract the component in place. This feature is
# useful for creating small installers that only download the
# requested components, saving bandwidth. Additionally, the
# installers are small enough that they will be installed as part of
# the normal installation process, and the "Change" button in
# Windows Add/Remove Programs control panel will allow one to add or
# remove parts of the application after the original
# installation. On Windows, the downloaded-components functionality
# requires the ZipDLL plug-in for NSIS, available at:
#
# http://nsis.sourceforge.net/ZipDLL_plug-in
#
# The site argument is a URL where the ZIP files for downloadable
# On Mac OS X, installers that download components on-the-fly can
# only be built and installed on system using Mac OS X 10.5 or
# later.
#
# The site argument is a URL where the archives for downloadable
# components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
# All of the ZIP files produced by CPack should be uploaded to that location.
# All of the archives produced by CPack should be uploaded to that location.
#
# UPLOAD_DIRECTORY is the local directory where CPack will create the
# various .ZIP archives for each of the components. The contents of this
# various archives for each of the components. The contents of this
# directory should be uploaded to a location accessible by the URL given
# in the site argument. If omitted, CPack will use the directory CPackUploads
# inside the CMake binary directory to store the generated ZIP files.
# inside the CMake binary directory to store the generated archives.
#
# The ALL flag indicates that all components be downloaded. Otherwise, only
# those components explicitly marked as DOWNLOADED or that have a specified
......@@ -363,7 +383,7 @@
# ADD_REMOVE indicates that CPack should install a copy of the installer
# that can be called from Windows' Add/Remove Programs dialog (via the
# "Modify" button) to change the set of installed components. NO_ADD_REMOVE
# turns off this behavior.
# turns off this behavior. This option is ignored on Mac OS X.
# Pick a configuration file
......
......@@ -349,6 +349,7 @@ TARGET_LINK_LIBRARIES(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_L
# Sources for CPack
#
SET(CPACK_SRCS
CPack/cmCPackComponentGroup.cxx
CPack/cmCPackGeneratorFactory.cxx
CPack/cmCPackGenerator.cxx
CPack/cmCPackLog.cxx
......
/*=========================================================================
Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "cmCPackComponentGroup.h"
#include "cmSystemTools.h"
#include <vector>
#include <string>
//----------------------------------------------------------------------
unsigned long cmCPackComponent::GetInstalledSize(const char* installDir) const
{
if (this->TotalSize != 0)
{
return this->TotalSize;
}
std::vector<std::string>::const_iterator fileIt;
for (fileIt = this->Files.begin(); fileIt != this->Files.end(); ++fileIt)
{
std::string path = installDir;
path += '/';
path += *fileIt;
this->TotalSize += cmSystemTools::FileLength(path.c_str());
}
return this->TotalSize;
}
//----------------------------------------------------------------------
unsigned long
cmCPackComponent::GetInstalledSizeInKbytes(const char* installDir) const
{
unsigned long result = (GetInstalledSize(installDir) + 512) / 1024;
return result? result : 1;
}
......@@ -49,7 +49,7 @@ public:
class cmCPackComponent
{
public:
cmCPackComponent() : Group(0) { }
cmCPackComponent() : Group(0), TotalSize(0) { }
/// The name of the component (used to reference the component).
std::string Name;
......@@ -95,6 +95,18 @@ public:
/// The list of installed directories that are part of this component.
std::vector<std::string> Directories;
/// Get the total installed size of all of the files in this
/// component, in bytes. installDir is the directory into which the
/// component was installed.
unsigned long GetInstalledSize(const char* installDir) const;
/// Identical to GetInstalledSize, but returns the result in
/// kilobytes.
unsigned long GetInstalledSizeInKbytes(const char* installDir) const;
private:
mutable unsigned long TotalSize;
};
/** \class cmCPackComponentGroup
......
......@@ -116,6 +116,7 @@ protected:
std::string EscapeForXML(std::string str);
double PackageMakerVersion;
double PackageCompatibilityVersion;
};
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment