ENH: Use specified output file name, also detect errors during install

This commit is contained in:
Andy Cedilnik 2006-01-09 18:24:39 -05:00
parent f219d3c263
commit 25f6a108ea
2 changed files with 10 additions and 4 deletions

View File

@ -52,7 +52,7 @@ FunctionEnd
;Name and file
Name "@CPACK_PACKAGE_NAME@ ${VERSION}"
OutFile "@CPACK_TOPLEVEL_DIRECTORY@/@CPACK_PACKAGE_NAME@-${VERSION}-${PATCH}-win32.exe"
OutFile "@CPACK_TOPLEVEL_DIRECTORY@/@CPACK_OUTPUT_FILE_NAME@"
;--------------------------------
;Interface Settings

View File

@ -50,6 +50,7 @@ int cmCPackGenericGenerator::PrepareNames()
tempDirectory += this->GetOption("CPACK_GENERATOR");
std::string topDirectory = tempDirectory;
/*
std::string outName = this->GetOption("CPACK_PACKAGE_NAME");
outName += "-";
outName += this->GetOption("CPACK_PACKAGE_VERSION");
@ -66,11 +67,12 @@ int cmCPackGenericGenerator::PrepareNames()
outName += postfix;
}
tempDirectory += "/" + outName;
*/
std::string outName = this->GetOption("CPACK_PACKAGE_FILE_NAME");
outName += ".";
outName += this->GetOutputExtension();
std::string installFile = this->GetOption("CPACK_PACKAGE_DIRECTORY");
installFile += "/cmake_install.cmake";
@ -84,7 +86,7 @@ int cmCPackGenericGenerator::PrepareNames()
this->SetOption("CPACK_TEMPORARY_DIRECTORY", tempDirectory.c_str());
this->SetOption("CPACK_INSTALL_FILE_NAME", installFile.c_str());
this->SetOption("CPACK_OUTPUT_FILE_NAME", outName.c_str());
this->SetOption("CPACK_PACKAGE_FILE_NAME", destFile.c_str());
this->SetOption("CPACK_OUTPUT_FILE_PATH", destFile.c_str());
this->SetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME", outFile.c_str());
this->SetOption("CPACK_INSTALL_DIRECTORY", this->GetInstallPath());
this->SetOption("CPACK_NATIVE_INSTALL_DIRECTORY",
@ -168,6 +170,10 @@ int cmCPackGenericGenerator::InstallProject()
cmSystemTools::PutEnv(destDir.c_str());
}
int res = mf->ReadListFile(0, installFile);
if ( cmSystemTools::GetErrorOccuredFlag() )
{
res = 0;
}
if ( !movable )
{
cmSystemTools::PutEnv("DESTDIR=");
@ -205,7 +211,7 @@ int cmCPackGenericGenerator::ProcessGenerator()
const char* tempPackageFileName = this->GetOption(
"CPACK_TEMPORARY_PACKAGE_FILE_NAME");
const char* packageFileName = this->GetOption("CPACK_PACKAGE_FILE_NAME");
const char* packageFileName = this->GetOption("CPACK_OUTPUT_FILE_PATH");
const char* tempDirectory = this->GetOption("CPACK_TEMPORARY_DIRECTORY");