summaryrefslogtreecommitdiffstats
path: root/Source/CPack
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CPack')
-rw-r--r--Source/CPack/IFW/cmCPackIFWGenerator.cxx6
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.cxx3
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx81
-rw-r--r--Source/CPack/cmCPackDragNDropGenerator.cxx2
-rw-r--r--Source/CPack/cmCPackGenerator.cxx5
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx12
-rw-r--r--Source/CPack/cmCPackOSXX11Generator.cxx6
-rw-r--r--Source/CPack/cmCPackPackageMakerGenerator.cxx11
-rw-r--r--Source/CPack/cpack.cxx4
9 files changed, 66 insertions, 64 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx
index 7f06e2d..0439ff6 100644
--- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx
+++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx
@@ -92,7 +92,8 @@ int cmCPackIFWGenerator::PackageFiles()
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"- Generate repository" << std::endl);
bool res = cmSystemTools::RunSingleCommand(
- ifwCmd.c_str(), &output, &retVal, 0, this->GeneratorVerbose, 0);
+ ifwCmd.c_str(), &output, &output,
+ &retVal, 0, this->GeneratorVerbose, 0);
if ( !res || retVal )
{
cmGeneratedFileStream ofs(ifwTmpFile.c_str());
@@ -176,7 +177,8 @@ int cmCPackIFWGenerator::PackageFiles()
int retVal = 1;
cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- Generate package" << std::endl);
bool res = cmSystemTools::RunSingleCommand(
- ifwCmd.c_str(), &output, &retVal, 0, this->GeneratorVerbose, 0);
+ ifwCmd.c_str(), &output, &output,
+ &retVal, 0, this->GeneratorVerbose, 0);
if ( !res || retVal )
{
cmGeneratedFileStream ofs(ifwTmpFile.c_str());
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index 99eabf2..b3eb7b2 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -64,7 +64,8 @@ bool cmCPackWIXGenerator::RunWiXCommand(std::string const& command)
std::string output;
int returnValue = 0;
- bool status = cmSystemTools::RunSingleCommand(command.c_str(), &output,
+ bool status = cmSystemTools::RunSingleCommand(
+ command.c_str(), &output, &output,
&returnValue, 0, cmSystemTools::OUTPUT_NONE);
cmsys::ofstream logFile(logFileName.c_str(), std::ios::app);
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index fcf4122..18597e8 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -90,7 +90,7 @@ int cmCPackDebGenerator::PackageOnePack(std::string initialTopLevel,
}
cmsys::Glob gl;
- std::string findExpr(this->GetOption("WDIR"));
+ std::string findExpr(this->GetOption("GEN_WDIR"));
findExpr += "/*";
gl.RecurseOn();
if ( !gl.FindFiles(findExpr) )
@@ -217,7 +217,7 @@ int cmCPackDebGenerator::PackageComponentsAllInOne()
}
cmsys::Glob gl;
- std::string findExpr(this->GetOption("WDIR"));
+ std::string findExpr(this->GetOption("GEN_WDIR"));
findExpr += "/*";
gl.RecurseOn();
if ( !gl.FindFiles(findExpr) )
@@ -286,7 +286,7 @@ int cmCPackDebGenerator::createDeb()
// debian-binary file
std::string dbfilename;
- dbfilename += this->GetOption("WDIR");
+ dbfilename += this->GetOption("GEN_WDIR");
dbfilename += "/debian-binary";
{ // the scope is needed for cmGeneratedFileStream
cmGeneratedFileStream out(dbfilename.c_str());
@@ -296,44 +296,47 @@ int cmCPackDebGenerator::createDeb()
// control file
std::string ctlfilename;
- ctlfilename = this->GetOption("WDIR");
+ ctlfilename = this->GetOption("GEN_WDIR");
ctlfilename += "/control";
// debian policy enforce lower case for package name
// mandatory entries:
std::string debian_pkg_name = cmsys::SystemTools::LowerCase(
- this->GetOption("CPACK_DEBIAN_PACKAGE_NAME") );
+ this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_NAME") );
const char* debian_pkg_version =
- this->GetOption("CPACK_DEBIAN_PACKAGE_VERSION");
+ this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_VERSION");
const char* debian_pkg_section =
- this->GetOption("CPACK_DEBIAN_PACKAGE_SECTION");
+ this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_SECTION");
const char* debian_pkg_priority =
- this->GetOption("CPACK_DEBIAN_PACKAGE_PRIORITY");
+ this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_PRIORITY");
const char* debian_pkg_arch =
- this->GetOption("CPACK_DEBIAN_PACKAGE_ARCHITECTURE");
- const char* maintainer = this->GetOption("CPACK_DEBIAN_PACKAGE_MAINTAINER");
- const char* desc = this->GetOption("CPACK_DEBIAN_PACKAGE_DESCRIPTION");
+ this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_ARCHITECTURE");
+ const char* maintainer =
+ this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_MAINTAINER");
+ const char* desc =
+ this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_DESCRIPTION");
// optional entries
- const char* debian_pkg_dep = this->GetOption("CPACK_DEBIAN_PACKAGE_DEPENDS");
+ const char* debian_pkg_dep =
+ this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_DEPENDS");
const char* debian_pkg_rec =
- this->GetOption("CPACK_DEBIAN_PACKAGE_RECOMMENDS");
+ this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_RECOMMENDS");
const char* debian_pkg_sug =
- this->GetOption("CPACK_DEBIAN_PACKAGE_SUGGESTS");
+ this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_SUGGESTS");
const char* debian_pkg_url =
- this->GetOption("CPACK_DEBIAN_PACKAGE_HOMEPAGE");
+ this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_HOMEPAGE");
const char* debian_pkg_predep =
- this->GetOption("CPACK_DEBIAN_PACKAGE_PREDEPENDS");
+ this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_PREDEPENDS");
const char* debian_pkg_enhances =
- this->GetOption("CPACK_DEBIAN_PACKAGE_ENHANCES");
+ this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_ENHANCES");
const char* debian_pkg_breaks =
- this->GetOption("CPACK_DEBIAN_PACKAGE_BREAKS");
+ this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_BREAKS");
const char* debian_pkg_conflicts =
- this->GetOption("CPACK_DEBIAN_PACKAGE_CONFLICTS");
+ this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_CONFLICTS");
const char* debian_pkg_provides =
- this->GetOption("CPACK_DEBIAN_PACKAGE_PROVIDES");
+ this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_PROVIDES");
const char* debian_pkg_replaces =
- this->GetOption("CPACK_DEBIAN_PACKAGE_REPLACES");
+ this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_REPLACES");
{ // the scope is needed for cmGeneratedFileStream
cmGeneratedFileStream out(ctlfilename.c_str());
@@ -399,13 +402,10 @@ int cmCPackDebGenerator::createDeb()
out << std::endl;
}
- std::string cmd;
- if (NULL != this->GetOption("CPACK_DEBIAN_FAKEROOT_EXECUTABLE")) {
- cmd += this->GetOption("CPACK_DEBIAN_FAKEROOT_EXECUTABLE");
- }
+ std::string cmd(this->GetOption("GEN_CPACK_DEBIAN_FAKEROOT_EXECUTABLE"));
const char* debian_compression_type =
- this->GetOption("CPACK_DEBIAN_COMPRESSION_TYPE");
+ this->GetOption("GEN_CPACK_DEBIAN_COMPRESSION_TYPE");
if(!debian_compression_type)
{
debian_compression_type = "gzip";
@@ -440,8 +440,9 @@ int cmCPackDebGenerator::createDeb()
// now add all directories which have to be compressed
// collect all top level install dirs for that
// e.g. /opt/bin/foo, /usr/bin/bar and /usr/bin/baz would give /usr and /opt
- size_t topLevelLength = std::string(this->GetOption("WDIR")).length();
- cmCPackLogger(cmCPackLog::LOG_DEBUG, "WDIR: \"" << this->GetOption("WDIR")
+ size_t topLevelLength = std::string(this->GetOption("GEN_WDIR")).length();
+ cmCPackLogger(cmCPackLog::LOG_DEBUG, "WDIR: \""
+ << this->GetOption("GEN_WDIR")
<< "\", length = " << topLevelLength
<< std::endl);
std::set<std::string> installDirs;
@@ -466,8 +467,8 @@ int cmCPackDebGenerator::createDeb()
std::string output;
int retval = -1;
- int res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output,
- &retval, this->GetOption("WDIR"), this->GeneratorVerbose, 0);
+ int res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output, &output,
+ &retval, this->GetOption("GEN_WDIR"), this->GeneratorVerbose, 0);
if ( !res || retval )
{
@@ -485,7 +486,7 @@ int cmCPackDebGenerator::createDeb()
}
std::string md5filename;
- md5filename = this->GetOption("WDIR");
+ md5filename = this->GetOption("GEN_WDIR");
md5filename += "/md5sums";
{ // the scope is needed for cmGeneratedFileStream
@@ -505,7 +506,7 @@ int cmCPackDebGenerator::createDeb()
cmd += "\"";
//std::string output;
//int retVal = -1;
- res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output,
+ res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output, &output,
&retval, toplevel.c_str(), this->GeneratorVerbose, 0);
if ( !res || retval )
{
@@ -523,14 +524,10 @@ int cmCPackDebGenerator::createDeb()
// Do not end the md5sum file with yet another (invalid)
}
- cmd = "";
- if (NULL != this->GetOption("CPACK_DEBIAN_FAKEROOT_EXECUTABLE"))
- {
- cmd = this->GetOption("CPACK_DEBIAN_FAKEROOT_EXECUTABLE");
- }
+ cmd = this->GetOption("GEN_CPACK_DEBIAN_FAKEROOT_EXECUTABLE");
cmd += cmake_tar + "tar czf control.tar.gz ./control ./md5sums";
const char* controlExtra =
- this->GetOption("CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA");
+ this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA");
if( controlExtra )
{
std::vector<std::string> controlExtraList;
@@ -540,7 +537,7 @@ int cmCPackDebGenerator::createDeb()
{
std::string filenamename =
cmsys::SystemTools::GetFilenameName(*i);
- std::string localcopy = this->GetOption("WDIR");
+ std::string localcopy = this->GetOption("GEN_WDIR");
localcopy += "/";
localcopy += filenamename;
// if we can copy the file, it means it does exist, let's add it:
@@ -553,8 +550,8 @@ int cmCPackDebGenerator::createDeb()
}
}
}
- res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output,
- &retval, this->GetOption("WDIR"), this->GeneratorVerbose, 0);
+ res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output, &output,
+ &retval, this->GetOption("GEN_WDIR"), this->GeneratorVerbose, 0);
if ( !res || retval )
{
@@ -575,7 +572,7 @@ int cmCPackDebGenerator::createDeb()
// since debian packages require BSD ar (most Linux distros and even
// FreeBSD and NetBSD ship GNU ar) we use a copy of OpenBSD ar here.
std::vector<std::string> arFiles;
- std::string topLevelString = this->GetOption("WDIR");
+ std::string topLevelString = this->GetOption("GEN_WDIR");
topLevelString += "/";
arFiles.push_back(topLevelString + "debian-binary");
arFiles.push_back(topLevelString + "control.tar.gz");
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 5da9234..4c400d9 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -197,7 +197,7 @@ bool cmCPackDragNDropGenerator::RunCommand(std::ostringstream& command,
bool result = cmSystemTools::RunSingleCommand(
command.str().c_str(),
- output,
+ output, output,
&exit_code,
0,
this->GeneratorVerbose,
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 2b18c41..e254e9a 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -290,7 +290,8 @@ int cmCPackGenerator::InstallProjectViaInstallCommands(
<< std::endl);
std::string output;
int retVal = 1;
- bool resB = cmSystemTools::RunSingleCommand(it->c_str(), &output,
+ bool resB = cmSystemTools::RunSingleCommand(
+ it->c_str(), &output, &output,
&retVal, 0, this->GeneratorVerbose, 0);
if ( !resB || retVal )
{
@@ -668,7 +669,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
int retVal = 1;
bool resB =
cmSystemTools::RunSingleCommand(buildCommand.c_str(),
- &output,
+ &output, &output,
&retVal,
installDirectory.c_str(),
this->GeneratorVerbose, 0);
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index fe6cc95..2de2bc4 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -324,7 +324,7 @@ int cmCPackNSISGenerator::PackageFiles()
<< std::endl);
std::string output;
int retVal = 1;
- bool res = cmSystemTools::RunSingleCommand(nsisCmd.c_str(), &output,
+ bool res = cmSystemTools::RunSingleCommand(nsisCmd.c_str(), &output, &output,
&retVal, 0, this->GeneratorVerbose, 0);
if ( !res || retVal )
{
@@ -430,8 +430,8 @@ int cmCPackNSISGenerator::InitializeInternal()
<< nsisCmd << std::endl);
std::string output;
int retVal = 1;
- bool resS = cmSystemTools::RunSingleCommand(nsisCmd.c_str(),
- &output, &retVal, 0, this->GeneratorVerbose, 0);
+ bool resS = cmSystemTools::RunSingleCommand(
+ nsisCmd.c_str(), &output, &output, &retVal, 0, this->GeneratorVerbose, 0);
cmsys::RegularExpression versionRex("v([0-9]+.[0-9]+)");
cmsys::RegularExpression versionRexCVS("v(.*)\\.cvs");
if ( !resS || retVal ||
@@ -836,9 +836,9 @@ CreateComponentDescription(cmCPackComponent *component,
zipListFileName.c_str());
std::string output;
int retVal = -1;
- int res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output, &retVal,
- dirName.c_str(),
- cmSystemTools::OUTPUT_NONE, 0);
+ int res = cmSystemTools::RunSingleCommand(
+ cmd.c_str(), &output, &output,
+ &retVal, dirName.c_str(), cmSystemTools::OUTPUT_NONE, 0);
if ( !res || retVal )
{
std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx
index 313e08b..d533af8 100644
--- a/Source/CPack/cmCPackOSXX11Generator.cxx
+++ b/Source/CPack/cmCPackOSXX11Generator.cxx
@@ -180,9 +180,9 @@ int cmCPackOSXX11Generator::PackageFiles()
bool res = false;
while(numTries > 0)
{
- res = cmSystemTools::RunSingleCommand(dmgCmd.str().c_str(), &output,
- &retVal, 0,
- this->GeneratorVerbose, 0);
+ res = cmSystemTools::RunSingleCommand(
+ dmgCmd.str().c_str(), &output, &output,
+ &retVal, 0, this->GeneratorVerbose, 0);
if ( res && !retVal )
{
numTries = -1;
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx
index dfe35c9..880663f 100644
--- a/Source/CPack/cmCPackPackageMakerGenerator.cxx
+++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx
@@ -378,9 +378,9 @@ int cmCPackPackageMakerGenerator::PackageFiles()
bool res = false;
while(numTries > 0)
{
- res = cmSystemTools::RunSingleCommand(dmgCmd.str().c_str(), &output,
- &retVal, 0, this->GeneratorVerbose,
- 0);
+ res = cmSystemTools::RunSingleCommand(
+ dmgCmd.str().c_str(), &output, &output,
+ &retVal, 0, this->GeneratorVerbose, 0);
if ( res && !retVal )
{
numTries = -1;
@@ -657,8 +657,9 @@ bool cmCPackPackageMakerGenerator::RunPackageMaker(const char *command,
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << command << std::endl);
std::string output;
int retVal = 1;
- bool res = cmSystemTools::RunSingleCommand(command, &output, &retVal, 0,
- this->GeneratorVerbose, 0);
+ bool res = cmSystemTools::RunSingleCommand(
+ command, &output, &output,
+ &retVal, 0, this->GeneratorVerbose, 0);
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Done running package maker"
<< std::endl);
if ( !res || retVal )
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 2752270..2207873 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -356,8 +356,8 @@ int main (int argc, char const* const* argv)
++it )
{
const char* gen = it->c_str();
- cmMakefile newMF(*globalMF);
- cmMakefile* mf = &newMF;
+ cmMakefile::ScopePushPop raii(globalMF);
+ cmMakefile* mf = globalMF;
cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE,
"Specified generator: " << gen << std::endl);
if ( parsed && !mf->GetDefinition("CPACK_PACKAGE_NAME") )