summaryrefslogtreecommitdiffstats
path: root/Source/CPack/cmCPackRPMGenerator.h
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/cmCPackRPMGenerator.h
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/cmCPackRPMGenerator.h')
-rw-r--r--Source/CPack/cmCPackRPMGenerator.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/CPack/cmCPackRPMGenerator.h b/Source/CPack/cmCPackRPMGenerator.h
index 4883a0d..eec8204 100644
--- a/Source/CPack/cmCPackRPMGenerator.h
+++ b/Source/CPack/cmCPackRPMGenerator.h
@@ -35,6 +35,17 @@ public:
cmCPackRPMGenerator();
virtual ~cmCPackRPMGenerator();
+ static bool CanGenerate()
+ {
+#ifdef __APPLE__
+ // on MacOS enable CPackRPM iff rpmbuild is found
+ return cmSystemTools::FindProgram("rpmbuild") != "" ? true : false;
+#else
+ // legacy behavior on other systems
+ return true;
+#endif
+ }
+
protected:
virtual int InitializeInternal();
virtual int PackageFiles();