summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-12-21 18:59:58 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2010-12-21 18:59:58 (GMT)
commit17025ebda1683d1dcd7d7119e151454e83a30cd7 (patch)
treee83ba29627087c18b618c61f4e5e6a4a501599c5
parent5615ecf31189c97d79958a99a349a42aa249a853 (diff)
parentcd9aa73f3a40b20ea6414779e4057ac236314d86 (diff)
downloadCMake-17025ebda1683d1dcd7d7119e151454e83a30cd7.zip
CMake-17025ebda1683d1dcd7d7119e151454e83a30cd7.tar.gz
CMake-17025ebda1683d1dcd7d7119e151454e83a30cd7.tar.bz2
Merge topic 'fix-8210-find-makensis-in-path'
cd9aa73 CPack: look for makensis in the PATH (#8210)
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx32
1 files changed, 23 insertions, 9 deletions
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index d0eda81..f25866c 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -337,6 +337,7 @@ int cmCPackNSISGenerator::InitializeInternal()
<< std::endl);
std::vector<std::string> path;
std::string nsisPath;
+ bool gotRegValue = true;
#ifdef _WIN32
if ( !cmsys::SystemTools::ReadRegistryValue(
@@ -346,24 +347,37 @@ int cmCPackNSISGenerator::InitializeInternal()
if ( !cmsys::SystemTools::ReadRegistryValue(
"HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath) )
{
- cmCPackLogger
- (cmCPackLog::LOG_ERROR,
- "Cannot find NSIS registry value. This is usually caused by NSIS "
- "not being installed. Please install NSIS from "
- "http://nsis.sourceforge.net"
- << std::endl);
- return 0;
+ gotRegValue = false;
}
}
- path.push_back(nsisPath);
+
+ if (gotRegValue)
+ {
+ path.push_back(nsisPath);
+ }
#endif
+
nsisPath = cmSystemTools::FindProgram("makensis", path, false);
+
if ( nsisPath.empty() )
{
- cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find NSIS compiler"
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Cannot find NSIS compiler makensis: likely it is not installed, "
+ "or not in your PATH"
<< std::endl);
+
+ if (!gotRegValue)
+ {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Could not read NSIS registry value. This is usually caused by "
+ "NSIS not being installed. Please install NSIS from "
+ "http://nsis.sourceforge.net"
+ << std::endl);
+ }
+
return 0;
}
+
std::string nsisCmd = "\"" + nsisPath + "\" " NSIS_OPT "VERSION";
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Test NSIS version: "
<< nsisCmd.c_str() << std::endl);