From 25f6a108ea2ad65580a7bf7514d0e05c1c06c62c Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Mon, 9 Jan 2006 18:24:39 -0500 Subject: ENH: Use specified output file name, also detect errors during install --- Modules/NSIS.template.in | 2 +- Source/CPack/cmCPackGenericGenerator.cxx | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Modules/NSIS.template.in b/Modules/NSIS.template.in index b48f832..f895a30 100644 --- a/Modules/NSIS.template.in +++ b/Modules/NSIS.template.in @@ -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 diff --git a/Source/CPack/cmCPackGenericGenerator.cxx b/Source/CPack/cmCPackGenericGenerator.cxx index 6da855e..80692b8 100644 --- a/Source/CPack/cmCPackGenericGenerator.cxx +++ b/Source/CPack/cmCPackGenericGenerator.cxx @@ -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"); -- cgit v0.12