summaryrefslogtreecommitdiffstats
path: root/Source/CPack/cmCPackGenerator.cxx
diff options
context:
space:
mode:
authorEric NOULARD <eric.noulard@gmail.com>2012-05-14 18:26:15 (GMT)
committerEric NOULARD <eric.noulard@gmail.com>2012-05-14 18:26:15 (GMT)
commit6ba055bacdce1cdf7a74008b980440027f275d94 (patch)
tree7f87b68f65c72a058dfd4cf544409fef0f7ecba9 /Source/CPack/cmCPackGenerator.cxx
parent75c0304a9ee646c8a408f713477fa3522ab1e8a8 (diff)
downloadCMake-6ba055bacdce1cdf7a74008b980440027f275d94.zip
CMake-6ba055bacdce1cdf7a74008b980440027f275d94.tar.gz
CMake-6ba055bacdce1cdf7a74008b980440027f275d94.tar.bz2
CPack add easy possibility to warn about CPACK_SET_DESTDIR
CPackNSIS will only warn but sooner or later it should error out
Diffstat (limited to 'Source/CPack/cmCPackGenerator.cxx')
-rw-r--r--Source/CPack/cmCPackGenerator.cxx32
1 files changed, 31 insertions, 1 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 0f832b3..bf65271 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -62,10 +62,31 @@ void cmCPackGenerator::DisplayVerboseOutput(const char* msg,
//----------------------------------------------------------------------
int cmCPackGenerator::PrepareNames()
-{
+{
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Create temp directory." << std::endl);
+ // checks CPACK_SET_DESTDIR support
+ if (IsOn("CPACK_SET_DESTDIR"))
+ {
+ if (SETDESTDIR_UNSUPPORTED==SupportsSetDestdir())
+ {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "CPACK_SET_DESTDIR is set to ON but the '"
+ << Name << "' generator does NOT support it."
+ << std::endl);
+ return 0;
+ }
+ else if (SETDESTDIR_SHOULD_NOT_BE_USED==SupportsSetDestdir())
+ {
+ cmCPackLogger(cmCPackLog::LOG_WARNING,
+ "CPACK_SET_DESTDIR is set to ON but it is "
+ << "usually a bad idea to do that with '"
+ << Name << "' generator. Use at your own risk."
+ << std::endl);
+ }
+ }
+
std::string tempDirectory = this->GetOption("CPACK_PACKAGE_DIRECTORY");
tempDirectory += "/_CPack_Packages/";
const char* toplevelTag = this->GetOption("CPACK_TOPLEVEL_TAG");
@@ -953,6 +974,8 @@ int cmCPackGenerator::DoPackage()
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"Create package using " << this->Name.c_str() << std::endl);
+ // Prepare CPack internal name and check
+ // values for many CPACK_xxx vars
if ( !this->PrepareNames() )
{
return 0;
@@ -1431,6 +1454,13 @@ std::string cmCPackGenerator::GetComponentPackageFileName(
}
//----------------------------------------------------------------------
+enum cmCPackGenerator::CPackSetDestdirSupport
+cmCPackGenerator::SupportsSetDestdir() const
+{
+ return cmCPackGenerator::SETDESTDIR_SUPPORTED;
+}
+
+//----------------------------------------------------------------------
bool cmCPackGenerator::SupportsComponentInstallation() const
{
return false;