Commit ee227d3a authored by Andy Cedilnik's avatar Andy Cedilnik

ENH: Several packaging issues. Allow random variables to be passed to cpack...

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
parent ac99baa4
......@@ -4,9 +4,9 @@
<plist version="1.0">
<dict>
<key>IFMajorVersion</key>
<integer>@CPACK_PACKAGE_MAJOR_VERSION@</integer>
<integer>@CPACK_PACKAGE_VERSION_MAJOR@</integer>
<key>IFMinorVersion</key>
<integer>@CPACK_PACKAGE_MINOR_VERSION@</integer>
<integer>@CPACK_PACKAGE_VERSION_MINOR@</integer>
<key>IFPkgFlagAllowBackRev</key>
<false/>
<key>IFPkgFlagAuthorizationAction</key>
......
......@@ -82,4 +82,13 @@ IF(CMake_INSTALL_SYSTEM_RUNTIME_LIBS)
ENDIF(WIN32)
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)
......@@ -355,7 +355,6 @@ Section "Dummy Section" SecDummy
;Create shortcuts
CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
@CPACK_NSIS_CREATE_ICONS@
@CPACK_NSIS_CREATE_EXTRA_ICONS@
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
@CPACK_NSIS_EXTRA_INSTALL_COMMANDS@
......@@ -415,7 +414,6 @@ Section "Uninstall"
Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
@CPACK_NSIS_DELETE_ICONS@
@CPACK_NSIS_DELETE_EXTRA_ICONS@
;Delete empty start menu parent diretories
StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
......
......@@ -101,7 +101,7 @@ int cmCPackGenericGenerator::PrepareNames()
if ( !this->GetOption("CPACK_PACKAGE_DESCRIPTION") )
{
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);
return 0;
}
......
......@@ -44,6 +44,7 @@
#include "cmFindPathCommand.cxx"
#include "cmFindProgramCommand.cxx"
#include "cmForEachCommand.cxx"
#include "cmGetCMakePropertyCommand.cxx"
#include "cmGetFilenameComponentCommand.cxx"
#include "cmGetSourceFilePropertyCommand.cxx"
#include "cmGetTargetPropertyCommand.cxx"
......@@ -102,6 +103,7 @@ void GetBootstrapCommands(std::list<cmCommand*>& commands)
commands.push_back(new cmFindPathCommand);
commands.push_back(new cmFindProgramCommand);
commands.push_back(new cmForEachCommand);
commands.push_back(new cmGetCMakePropertyCommand);
commands.push_back(new cmGetFilenameComponentCommand);
commands.push_back(new cmGetSourceFilePropertyCommand);
commands.push_back(new cmGetTargetPropertyCommand);
......
......@@ -22,7 +22,6 @@
#include "cmExportLibraryDependencies.cxx"
#include "cmEnableLanguageCommand.cxx"
#include "cmFLTKWrapUICommand.cxx"
#include "cmGetCMakePropertyCommand.cxx"
#include "cmGetDirectoryPropertyCommand.cxx"
#include "cmGetTestPropertyCommand.cxx"
#include "cmIncludeExternalMSProjectCommand.cxx"
......@@ -66,7 +65,6 @@ void GetPredefinedCommands(std::list<cmCommand*>&
commands.push_back(new cmExecuteProcessCommand);
commands.push_back(new cmExportLibraryDependenciesCommand);
commands.push_back(new cmFLTKWrapUICommand);
commands.push_back(new cmGetCMakePropertyCommand);
commands.push_back(new cmGetDirectoryPropertyCommand);
commands.push_back(new cmGetTestPropertyCommand);
commands.push_back(new cmIncludeExternalMSProjectCommand);
......
......@@ -1226,6 +1226,10 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
configFile += "/CPackConfig.cmake";
singleLine.push_back(configFile);
cpackCommandLines.push_back(singleLine);
if ( this->GetPreInstallAvailable() )
{
depends.push_back("preinstall");
}
(*targets)[this->GetPackageTargetName()]
= this->CreateGlobalTarget(this->GetPackageTargetName(),
"Run CPack packaging tool...", &cpackCommandLines, depends);
......
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@")
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@")
# There are certain generator specific ones
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@")
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@")
@_CPACK_OTHER_VARIABLES_@
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