summaryrefslogtreecommitdiffstats
path: root/Source/CPack/cmCPackGeneratorFactory.cxx
diff options
context:
space:
mode:
authorEric NOULARD <eric.noulard@gmail.com>2012-03-30 15:07:06 (GMT)
committerEric NOULARD <eric.noulard@gmail.com>2012-05-20 20:04:32 (GMT)
commit2a34b579381cd73a18553c331d91b99a42292367 (patch)
treed4c0ae6331fcbd1b4122ed3f364875ffd861d692 /Source/CPack/cmCPackGeneratorFactory.cxx
parent77ec098b44ea036078a574754b6c935837a2fd75 (diff)
downloadCMake-2a34b579381cd73a18553c331d91b99a42292367.zip
CMake-2a34b579381cd73a18553c331d91b99a42292367.tar.gz
CMake-2a34b579381cd73a18553c331d91b99a42292367.tar.bz2
CPack allow RPM and DEB generator to be used on OSX.
More generally add the check for possible generator "activation" at runtime depending on a generator specific check. The dynamic behavior is currently implemented only for MacOS and should be fully backward compatible for other system. Inspired-By Tom Hughes <tomtheengineer@gmail.com>
Diffstat (limited to 'Source/CPack/cmCPackGeneratorFactory.cxx')
-rw-r--r--Source/CPack/cmCPackGeneratorFactory.cxx102
1 files changed, 72 insertions, 30 deletions
diff --git a/Source/CPack/cmCPackGeneratorFactory.cxx b/Source/CPack/cmCPackGeneratorFactory.cxx
index a04b403..dbfdbbc 100644
--- a/Source/CPack/cmCPackGeneratorFactory.cxx
+++ b/Source/CPack/cmCPackGeneratorFactory.cxx
@@ -31,7 +31,7 @@
# include "cmCPackCygwinSourceGenerator.h"
#endif
-#if !defined(_WIN32) && !defined(__APPLE__) \
+#if !defined(_WIN32) \
&& !defined(__QNXNTO__) && !defined(__BEOS__)
# include "cmCPackDebGenerator.h"
# include "cmCPackRPMGenerator.h"
@@ -43,41 +43,83 @@
//----------------------------------------------------------------------
cmCPackGeneratorFactory::cmCPackGeneratorFactory()
{
- this->RegisterGenerator("TGZ", "Tar GZip compression",
- cmCPackTGZGenerator::CreateGenerator);
- this->RegisterGenerator("STGZ", "Self extracting Tar GZip compression",
- cmCPackSTGZGenerator::CreateGenerator);
- this->RegisterGenerator("NSIS", "Null Soft Installer",
- cmCPackNSISGenerator::CreateGenerator);
+ if (cmCPackTGZGenerator::CanGenerate())
+ {
+ this->RegisterGenerator("TGZ", "Tar GZip compression",
+ cmCPackTGZGenerator::CreateGenerator);
+ }
+ if (cmCPackSTGZGenerator::CanGenerate())
+ {
+ this->RegisterGenerator("STGZ", "Self extracting Tar GZip compression",
+ cmCPackSTGZGenerator::CreateGenerator);
+ }
+ if (cmCPackNSISGenerator::CanGenerate())
+ {
+ this->RegisterGenerator("NSIS", "Null Soft Installer",
+ cmCPackNSISGenerator::CreateGenerator);
+ }
#ifdef __CYGWIN__
- this->RegisterGenerator("CygwinBinary", "Cygwin Binary Installer",
- cmCPackCygwinBinaryGenerator::CreateGenerator);
- this->RegisterGenerator("CygwinSource", "Cygwin Source Installer",
- cmCPackCygwinSourceGenerator::CreateGenerator);
+ if (cmCPackCygwinBinaryGenerator::CanGenerate())
+ {
+ this->RegisterGenerator("CygwinBinary", "Cygwin Binary Installer",
+ cmCPackCygwinBinaryGenerator::CreateGenerator);
+ }
+ if (cmCPackCygwinSourceGenerator::CanGenerate())
+ {
+ this->RegisterGenerator("CygwinSource", "Cygwin Source Installer",
+ cmCPackCygwinSourceGenerator::CreateGenerator);
+ }
#endif
- this->RegisterGenerator("ZIP", "ZIP file format",
- cmCPackZIPGenerator::CreateGenerator);
- this->RegisterGenerator("TBZ2", "Tar BZip2 compression",
- cmCPackTarBZip2Generator::CreateGenerator);
- this->RegisterGenerator("TZ", "Tar Compress compression",
- cmCPackTarCompressGenerator::CreateGenerator);
+ if (cmCPackZIPGenerator::CanGenerate())
+ {
+ this->RegisterGenerator("ZIP", "ZIP file format",
+ cmCPackZIPGenerator::CreateGenerator);
+ }
+ if (cmCPackTarBZip2Generator::CanGenerate())
+ {
+ this->RegisterGenerator("TBZ2", "Tar BZip2 compression",
+ cmCPackTarBZip2Generator::CreateGenerator);
+ }
+ if (cmCPackTarCompressGenerator::CanGenerate())
+ {
+ this->RegisterGenerator("TZ", "Tar Compress compression",
+ cmCPackTarCompressGenerator::CreateGenerator);
+ }
#ifdef __APPLE__
- this->RegisterGenerator("DragNDrop", "Mac OSX Drag And Drop",
- cmCPackDragNDropGenerator::CreateGenerator);
- this->RegisterGenerator("Bundle", "Mac OSX bundle",
- cmCPackBundleGenerator::CreateGenerator);
- this->RegisterGenerator("PackageMaker", "Mac OSX Package Maker installer",
- cmCPackPackageMakerGenerator::CreateGenerator);
- this->RegisterGenerator("OSXX11", "Mac OSX X11 bundle",
- cmCPackOSXX11Generator::CreateGenerator);
+ if (cmCPackDragNDropGenerator::CanGenerate())
+ {
+ this->RegisterGenerator("DragNDrop", "Mac OSX Drag And Drop",
+ cmCPackDragNDropGenerator::CreateGenerator);
+ }
+ if (cmCPackBundleGenerator::CanGenerate())
+ {
+ this->RegisterGenerator("Bundle", "Mac OSX bundle",
+ cmCPackBundleGenerator::CreateGenerator);
+ }
+ if (cmCPackPackageMakerGenerator::CanGenerate())
+ {
+ this->RegisterGenerator("PackageMaker", "Mac OSX Package Maker installer",
+ cmCPackPackageMakerGenerator::CreateGenerator);
+ }
+ if (cmCPackOSXX11Generator::CanGenerate())
+ {
+ this->RegisterGenerator("OSXX11", "Mac OSX X11 bundle",
+ cmCPackOSXX11Generator::CreateGenerator);
+ }
#endif
-#if !defined(_WIN32) && !defined(__APPLE__) \
+#if !defined(_WIN32) \
&& !defined(__QNXNTO__) && !defined(__BEOS__)
- this->RegisterGenerator("DEB", "Debian packages",
- cmCPackDebGenerator::CreateGenerator);
- this->RegisterGenerator("RPM", "RPM packages",
- cmCPackRPMGenerator::CreateGenerator);
+ if (cmCPackDebGenerator::CanGenerate())
+ {
+ this->RegisterGenerator("DEB", "Debian packages",
+ cmCPackDebGenerator::CreateGenerator);
+ }
+ if (cmCPackRPMGenerator::CanGenerate())
+ {
+ this->RegisterGenerator("RPM", "RPM packages",
+ cmCPackRPMGenerator::CreateGenerator);
+ }
#endif
}