summaryrefslogtreecommitdiffstats
path: root/Source/CPack/cmCPackNSISGenerator.cxx
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-06-18 13:00:33 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-06-18 13:00:33 (GMT)
commitef81ac50e5d6e981088c00e822fde538d9da9e37 (patch)
treed35cdfb24250eb7a6338df1caed241c53708c377 /Source/CPack/cmCPackNSISGenerator.cxx
parentdbbd5214612faeb65c24a715bfaa35a6c0e63e06 (diff)
downloadCMake-ef81ac50e5d6e981088c00e822fde538d9da9e37.zip
CMake-ef81ac50e5d6e981088c00e822fde538d9da9e37.tar.gz
CMake-ef81ac50e5d6e981088c00e822fde538d9da9e37.tar.bz2
ENH: NSIS exists also for Linux, not only Windows, so enable it there too
patch by Michal Čihař <michal (AT) cihar.com> Alex
Diffstat (limited to 'Source/CPack/cmCPackNSISGenerator.cxx')
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index f973acc..dc1b852 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -29,6 +29,13 @@
#include <cmsys/Directory.hxx>
#include <cmsys/RegularExpression.hxx>
+/* NSIS uses different command line syntax on Windows and others */
+#ifdef _WIN32
+# define NSIS_OPT "/"
+#else
+# define NSIS_OPT "-"
+#endif
+
//----------------------------------------------------------------------
cmCPackNSISGenerator::cmCPackNSISGenerator()
{
@@ -144,6 +151,8 @@ int cmCPackNSISGenerator::InitializeInternal()
<< std::endl);
std::vector<std::string> path;
std::string nsisPath;
+
+#ifdef _WIN32
if ( !cmsys::SystemTools::ReadRegistryValue(
"HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath) )
{
@@ -156,6 +165,7 @@ int cmCPackNSISGenerator::InitializeInternal()
return 0;
}
path.push_back(nsisPath);
+#endif
nsisPath = cmSystemTools::FindProgram("makensis", path, false);
if ( nsisPath.empty() )
{
@@ -163,7 +173,7 @@ int cmCPackNSISGenerator::InitializeInternal()
<< std::endl);
return 0;
}
- std::string nsisCmd = "\"" + nsisPath + "\" /VERSION";
+ std::string nsisCmd = "\"" + nsisPath + "\" " NSIS_OPT "VERSION";
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Test NSIS version: "
<< nsisCmd.c_str() << std::endl);
std::string output;