ENH: Several packaging issues. Allow random variables to be passed to cpack (anything starting with CPACK_, add preinstall to the list of dependencies for package, fix typos

This commit is contained in:
Andy Cedilnik 2006-02-27 10:58:20 -05:00
parent ac99baa44d
commit ee227d3af5
8 changed files with 41 additions and 26 deletions

View File

@ -4,9 +4,9 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>IFMajorVersion</key> <key>IFMajorVersion</key>
<integer>@CPACK_PACKAGE_MAJOR_VERSION@</integer> <integer>@CPACK_PACKAGE_VERSION_MAJOR@</integer>
<key>IFMinorVersion</key> <key>IFMinorVersion</key>
<integer>@CPACK_PACKAGE_MINOR_VERSION@</integer> <integer>@CPACK_PACKAGE_VERSION_MINOR@</integer>
<key>IFPkgFlagAllowBackRev</key> <key>IFPkgFlagAllowBackRev</key>
<false/> <false/>
<key>IFPkgFlagAuthorizationAction</key> <key>IFPkgFlagAuthorizationAction</key>

View File

@ -82,4 +82,13 @@ IF(CMake_INSTALL_SYSTEM_RUNTIME_LIBS)
ENDIF(WIN32) ENDIF(WIN32)
ENDIF(CMake_INSTALL_SYSTEM_RUNTIME_LIBS) ENDIF(CMake_INSTALL_SYSTEM_RUNTIME_LIBS)
SET(_CPACK_UNUSED_VARIABLES_)
GET_CMAKE_PROPERTY(res VARIABLES)
FOREACH(var ${res})
IF("xxx${var}" MATCHES "xxxCPACK")
SET(_CPACK_OTHER_VARIABLES_
"${_CPACK_OTHER_VARIABLES_}\nSET(${var} \"${${var}}\")")
ENDIF("xxx${var}" MATCHES "xxxCPACK")
ENDFOREACH(var ${res})
CONFIGURE_FILE("${cpack_input_file}" "${CMAKE_BINARY_DIR}/CPackConfig.cmake" @ONLY IMMEDIATE) CONFIGURE_FILE("${cpack_input_file}" "${CMAKE_BINARY_DIR}/CPackConfig.cmake" @ONLY IMMEDIATE)

View File

@ -355,7 +355,6 @@ Section "Dummy Section" SecDummy
;Create shortcuts ;Create shortcuts
CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER" CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
@CPACK_NSIS_CREATE_ICONS@ @CPACK_NSIS_CREATE_ICONS@
@CPACK_NSIS_CREATE_EXTRA_ICONS@
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe" CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
@CPACK_NSIS_EXTRA_INSTALL_COMMANDS@ @CPACK_NSIS_EXTRA_INSTALL_COMMANDS@
@ -415,7 +414,6 @@ Section "Uninstall"
Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk" Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
@CPACK_NSIS_DELETE_ICONS@ @CPACK_NSIS_DELETE_ICONS@
@CPACK_NSIS_DELETE_EXTRA_ICONS@
;Delete empty start menu parent diretories ;Delete empty start menu parent diretories
StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP" StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"

View File

@ -101,7 +101,7 @@ int cmCPackGenericGenerator::PrepareNames()
if ( !this->GetOption("CPACK_PACKAGE_DESCRIPTION") ) if ( !this->GetOption("CPACK_PACKAGE_DESCRIPTION") )
{ {
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_ERROR,
"Project description not specified. Please specify CPACK_PACKAGE_DESCRIPTION or CPACK_PACKAGE_DESCRIPTION_FILE_NAME." "Project description not specified. Please specify CPACK_PACKAGE_DESCRIPTION or CPACK_PACKAGE_DESCRIPTION_FILE."
<< std::endl); << std::endl);
return 0; return 0;
} }

View File

@ -44,6 +44,7 @@
#include "cmFindPathCommand.cxx" #include "cmFindPathCommand.cxx"
#include "cmFindProgramCommand.cxx" #include "cmFindProgramCommand.cxx"
#include "cmForEachCommand.cxx" #include "cmForEachCommand.cxx"
#include "cmGetCMakePropertyCommand.cxx"
#include "cmGetFilenameComponentCommand.cxx" #include "cmGetFilenameComponentCommand.cxx"
#include "cmGetSourceFilePropertyCommand.cxx" #include "cmGetSourceFilePropertyCommand.cxx"
#include "cmGetTargetPropertyCommand.cxx" #include "cmGetTargetPropertyCommand.cxx"
@ -102,6 +103,7 @@ void GetBootstrapCommands(std::list<cmCommand*>& commands)
commands.push_back(new cmFindPathCommand); commands.push_back(new cmFindPathCommand);
commands.push_back(new cmFindProgramCommand); commands.push_back(new cmFindProgramCommand);
commands.push_back(new cmForEachCommand); commands.push_back(new cmForEachCommand);
commands.push_back(new cmGetCMakePropertyCommand);
commands.push_back(new cmGetFilenameComponentCommand); commands.push_back(new cmGetFilenameComponentCommand);
commands.push_back(new cmGetSourceFilePropertyCommand); commands.push_back(new cmGetSourceFilePropertyCommand);
commands.push_back(new cmGetTargetPropertyCommand); commands.push_back(new cmGetTargetPropertyCommand);

View File

@ -22,7 +22,6 @@
#include "cmExportLibraryDependencies.cxx" #include "cmExportLibraryDependencies.cxx"
#include "cmEnableLanguageCommand.cxx" #include "cmEnableLanguageCommand.cxx"
#include "cmFLTKWrapUICommand.cxx" #include "cmFLTKWrapUICommand.cxx"
#include "cmGetCMakePropertyCommand.cxx"
#include "cmGetDirectoryPropertyCommand.cxx" #include "cmGetDirectoryPropertyCommand.cxx"
#include "cmGetTestPropertyCommand.cxx" #include "cmGetTestPropertyCommand.cxx"
#include "cmIncludeExternalMSProjectCommand.cxx" #include "cmIncludeExternalMSProjectCommand.cxx"
@ -66,7 +65,6 @@ void GetPredefinedCommands(std::list<cmCommand*>&
commands.push_back(new cmExecuteProcessCommand); commands.push_back(new cmExecuteProcessCommand);
commands.push_back(new cmExportLibraryDependenciesCommand); commands.push_back(new cmExportLibraryDependenciesCommand);
commands.push_back(new cmFLTKWrapUICommand); commands.push_back(new cmFLTKWrapUICommand);
commands.push_back(new cmGetCMakePropertyCommand);
commands.push_back(new cmGetDirectoryPropertyCommand); commands.push_back(new cmGetDirectoryPropertyCommand);
commands.push_back(new cmGetTestPropertyCommand); commands.push_back(new cmGetTestPropertyCommand);
commands.push_back(new cmIncludeExternalMSProjectCommand); commands.push_back(new cmIncludeExternalMSProjectCommand);

View File

@ -1226,6 +1226,10 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
configFile += "/CPackConfig.cmake"; configFile += "/CPackConfig.cmake";
singleLine.push_back(configFile); singleLine.push_back(configFile);
cpackCommandLines.push_back(singleLine); cpackCommandLines.push_back(singleLine);
if ( this->GetPreInstallAvailable() )
{
depends.push_back("preinstall");
}
(*targets)[this->GetPackageTargetName()] (*targets)[this->GetPackageTargetName()]
= this->CreateGlobalTarget(this->GetPackageTargetName(), = this->CreateGlobalTarget(this->GetPackageTargetName(),
"Run CPack packaging tool...", &cpackCommandLines, depends); "Run CPack packaging tool...", &cpackCommandLines, depends);

View File

@ -1,22 +1,26 @@
SET(CPACK_GENERATOR "@CPACK_GENERATOR@") # This file will be configured to contain variables for CPack. These variables
# should be set in the CMake list file of the project before CPack module is
# included. Example variables are:
# CPACK_BINARY_DIR - Path to the build tree
# CPACK_GENERATOR - Generator used to create package
# CPACK_PACKAGE_DESCRIPTION_FILE - Description file for the package
# CPACK_PACKAGE_DESCRIPTION_SUMMARY - Summary of the package
# CPACK_PACKAGE_EXECUTABLES - List of pairs of executables and labels
# CPACK_PACKAGE_FILE_NAME - Name of the package generated
# CPACK_PACKAGE_ICON - Icon used for the package
# CPACK_PACKAGE_INSTALL_DIRECTORY - Name of directory for the installer
# CPACK_PACKAGE_NAME - Package project name
# CPACK_PACKAGE_VENDOR - Package project vendor
# CPACK_PACKAGE_VERSION - Package project version
# CPACK_PACKAGE_VERSION_MAJOR - Package project version (major)
# CPACK_PACKAGE_VERSION_MINOR - Package project version (minor)
# CPACK_PACKAGE_VERSION_PATCH - Package project version (patch)
SET(CPACK_PACKAGE_NAME "@CPACK_PACKAGE_NAME@") # There are certain generator specific ones
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "@CPACK_PACKAGE_INSTALL_DIRECTORY@")
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@")
SET(CPACK_PACKAGE_VERSION_MAJOR "@CPACK_PACKAGE_VERSION_MAJOR@")
SET(CPACK_PACKAGE_VERSION_MINOR "@CPACK_PACKAGE_VERSION_MINOR@")
SET(CPACK_PACKAGE_VERSION_PATCH "@CPACK_PACKAGE_VERSION_PATCH@")
SET(CPACK_PACKAGE_VENDOR "@CPACK_PACKAGE_VENDOR@") # NSIS Generator:
# CPACK_PACKAGE_INSTALL_REGISTRY_KEY - Name of the registry key for the installer
# CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS - Extra commands used during uninstall
# CPACK_NSIS_EXTRA_INSTALL_COMMANDS - Extra commands used during install
SET(CPACK_PACKAGE_FILE_NAME "@CPACK_PACKAGE_FILE_NAME@") @_CPACK_OTHER_VARIABLES_@
SET(CPACK_PACKAGE_EXECUTABLES "@CPACK_PACKAGE_EXECUTABLES@")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "@CPACK_PACKAGE_DESCRIPTION_SUMMARY@")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "@CPACK_PACKAGE_DESCRIPTION_FILE@")
# It is a CMake project, so we need a binary directory
SET(CPACK_BINARY_DIR "@CPACK_BINARY_DIR@")
SET(CPACK_PACKAGE_ICON "@CPACK_PACKAGE_ICON@")