[cmake-commits] alex committed cmCPackGenerators.cxx 1.14 1.15 cmCPackNSISGenerator.cxx 1.20 1.21

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Jun 18 09:00:35 EDT 2007


Update of /cvsroot/CMake/CMake/Source/CPack
In directory public:/mounts/ram/cvs-serv4677

Modified Files:
	cmCPackGenerators.cxx cmCPackNSISGenerator.cxx 
Log Message:

ENH: NSIS exists also for Linux, not only Windows, so enable it there too
patch by   Michal ÄŒihaÅ™ <michal (AT) cihar.com>

Alex


Index: cmCPackGenerators.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/cmCPackGenerators.cxx,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- cmCPackGenerators.cxx	2 Feb 2007 19:40:25 -0000	1.14
+++ cmCPackGenerators.cxx	18 Jun 2007 13:00:32 -0000	1.15
@@ -23,9 +23,7 @@
 #include "cmCPackTarCompressGenerator.h"
 #include "cmCPackZIPGenerator.h"
 #include "cmCPackSTGZGenerator.h"
-#ifdef _WIN32
-#  include "cmCPackNSISGenerator.h"
-#endif
+#include "cmCPackNSISGenerator.h"
 #ifdef __APPLE__
 #  include "cmCPackPackageMakerGenerator.h"
 #  include "cmCPackOSXX11Generator.h"
@@ -45,10 +43,8 @@
     cmCPackTGZGenerator::CreateGenerator);
   this->RegisterGenerator("STGZ", "Self extracting Tar GZip compression",
     cmCPackSTGZGenerator::CreateGenerator);
-#ifdef _WIN32
   this->RegisterGenerator("NSIS", "Null Soft Installer",
     cmCPackNSISGenerator::CreateGenerator);
-#endif
 #ifdef __CYGWIN__
   this->RegisterGenerator("CygwinBinary", "Cygwin Binary Installer",
                           cmCPackCygwinBinaryGenerator::CreateGenerator);

Index: cmCPackNSISGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/cmCPackNSISGenerator.cxx,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- cmCPackNSISGenerator.cxx	17 Nov 2006 16:14:04 -0000	1.20
+++ cmCPackNSISGenerator.cxx	18 Jun 2007 13:00:33 -0000	1.21
@@ -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 @@
     << 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 @@
     return 0;
     }
   path.push_back(nsisPath);
+#endif
   nsisPath = cmSystemTools::FindProgram("makensis", path, false);
   if ( nsisPath.empty() )
     {
@@ -163,7 +173,7 @@
       << 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;



More information about the Cmake-commits mailing list