summaryrefslogtreecommitdiffstats
path: root/Source/CPack/cmCPackNSISGenerator.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2006-01-02 21:14:21 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2006-01-02 21:14:21 (GMT)
commitbbf1c2d275ce58a76cfe5d3a6539a3bb490456b7 (patch)
tree73ebeba061fde907454361a8d51e7f9ddadbaa81 /Source/CPack/cmCPackNSISGenerator.cxx
parent9d0f86d7d017aa00420800bd72e00d45681710c9 (diff)
downloadCMake-bbf1c2d275ce58a76cfe5d3a6539a3bb490456b7.zip
CMake-bbf1c2d275ce58a76cfe5d3a6539a3bb490456b7.tar.gz
CMake-bbf1c2d275ce58a76cfe5d3a6539a3bb490456b7.tar.bz2
ENH: More improvements and add logging
Diffstat (limited to 'Source/CPack/cmCPackNSISGenerator.cxx')
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index 35b5a99..8dd31de 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -23,6 +23,7 @@
#include "cmSystemTools.h"
#include "cmMakefile.h"
#include "cmGeneratedFileStream.h"
+#include "cmCPackLog.h"
#include <cmsys/SystemTools.hxx>
#include <cmsys/Glob.hxx>
@@ -53,19 +54,19 @@ int cmCPackNSISGenerator::CompressFiles(const char* outFileName, const char* top
std::string nsisInFileName = this->FindTemplate("NSIS.template.in");
if ( nsisInFileName.size() == 0 )
{
- std::cerr << "CPack error: Could not find NSIS installer template file." << std::endl;
+ cmCPackLogger(cmCPackLog::LOG_ERROR, "CPack error: Could not find NSIS installer template file." << std::endl);
return false;
}
std::string nsisFileName = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
std::string tmpFile = nsisFileName;
tmpFile += "/NSISOutput.log";
nsisFileName += "/project.nsi";
- std::cout << "Configure file: " << nsisInFileName << " to " << nsisFileName << std::endl;
+ cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: " << nsisInFileName << " to " << nsisFileName << std::endl);
this->ConfigureFile(nsisInFileName.c_str(), nsisFileName.c_str());
std::string nsisCmd = "\"";
nsisCmd += this->GetOption("CPACK_INSTALLER_PROGRAM");
nsisCmd += "\" \"" + nsisFileName + "\"";
- std::cout << "Execute: " << nsisCmd.c_str() << std::endl;
+ cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << nsisCmd.c_str() << std::endl);
std::string output;
int retVal = 1;
bool res = cmSystemTools::RunSingleCommand(nsisCmd.c_str(), &output, &retVal, 0, m_GeneratorVerbose, 0);
@@ -75,8 +76,8 @@ int cmCPackNSISGenerator::CompressFiles(const char* outFileName, const char* top
ofs << "# Run command: " << nsisCmd.c_str() << std::endl
<< "# Output:" << std::endl
<< output.c_str() << std::endl;
- std::cerr << "Problem running NSIS command: " << nsisCmd.c_str() << std::endl;
- std::cerr << "Please check " << tmpFile.c_str() << " for errors" << std::endl;
+ cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running NSIS command: " << nsisCmd.c_str() << std::endl
+ << "Please check " << tmpFile.c_str() << " for errors" << std::endl);
return 0;
}
return 1;
@@ -85,21 +86,21 @@ int cmCPackNSISGenerator::CompressFiles(const char* outFileName, const char* top
//----------------------------------------------------------------------
int cmCPackNSISGenerator::Initialize(const char* name)
{
- std::cout << "cmCPackNSISGenerator::Initialize()" << std::endl;
+ cmCPackLogger(cmCPackLog::LOG_DEBUG, "cmCPackNSISGenerator::Initialize()" << std::endl);
int res = this->Superclass::Initialize(name);
std::vector<std::string> path;
std::string nsisPath;
if ( !cmsys::SystemTools::ReadRegistryValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS",
nsisPath) )
{
- std::cerr << "Cannot find NSIS registry value" << std::endl;
+ cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find NSIS registry value" << std::endl);
return 0;
}
path.push_back(nsisPath);
nsisPath = cmSystemTools::FindProgram("makensis", path, false);
if ( nsisPath.empty() )
{
- std::cerr << "Cannot find NSIS compiler" << std::endl;
+ cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find NSIS compiler" << std::endl);
return 0;
}
this->SetOption("CPACK_INSTALLER_PROGRAM", nsisPath.c_str());