summaryrefslogtreecommitdiffstats
path: root/Source/CPack
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-01-24 13:51:56 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-01-24 13:52:03 (GMT)
commit1a9da3c055d84479dc011ff66ecf887d92fadf23 (patch)
tree53dd65bd85e221099816c95324799e4b0e46103d /Source/CPack
parent56fd8b3c7272e3d57333a86b2214f8673b9d557a (diff)
parent93bc5848e75101477215c3131b7b7ff2b4eb7053 (diff)
downloadCMake-1a9da3c055d84479dc011ff66ecf887d92fadf23.zip
CMake-1a9da3c055d84479dc011ff66ecf887d92fadf23.tar.gz
CMake-1a9da3c055d84479dc011ff66ecf887d92fadf23.tar.bz2
Merge topic 'cpack_trace'
93bc5848 CPack: accept --trace and --trace-expand Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1583
Diffstat (limited to 'Source/CPack')
-rw-r--r--Source/CPack/cmCPackGenerator.cxx2
-rw-r--r--Source/CPack/cmCPackGenerator.h12
-rw-r--r--Source/CPack/cpack.cxx20
3 files changed, 34 insertions, 0 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index ea0e899..69e53e1 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -637,6 +637,8 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
cm.GetCurrentSnapshot().SetDefaultDefinitions();
cm.AddCMakePaths();
cm.SetProgressCallback(cmCPackGeneratorProgress, this);
+ cm.SetTrace(this->Trace);
+ cm.SetTraceExpand(this->TraceExpand);
cmGlobalGenerator gg(&cm);
cmMakefile mf(&gg, cm.GetCurrentSnapshot());
if (!installSubDirectory.empty() && installSubDirectory != "/" &&
diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h
index 8100b66..c22f36b 100644
--- a/Source/CPack/cmCPackGenerator.h
+++ b/Source/CPack/cmCPackGenerator.h
@@ -36,6 +36,16 @@ public:
}
/**
+ * Put underlying cmake scripts in trace mode.
+ */
+ void SetTrace(bool val) { this->Trace = val; }
+
+ /**
+ * Put underlying cmake scripts in expanded trace mode.
+ */
+ void SetTraceExpand(bool val) { this->TraceExpand = val; }
+
+ /**
* Returns true if the generator may work on this system.
* Rational:
* Some CPack generator may run on some host and may not on others
@@ -295,6 +305,8 @@ protected:
ComponentPackageMethod componentPackageMethod;
cmCPackLog* Logger;
+ bool Trace;
+ bool TraceExpand;
private:
cmMakefile* MakefileMap;
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 3e9bce9..2b2152c 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -43,6 +43,8 @@ static const char* cmDocumentationOptions[][2] = {
{ "-D <var>=<value>", "Set a CPack variable." },
{ "--config <config file>", "Specify the config file." },
{ "--verbose,-V", "enable verbose output" },
+ { "--trace", "Put underlying cmake scripts in trace mode." },
+ { "--trace-expand", "Put underlying cmake scripts in expanded trace mode." },
{ "--debug", "enable debug output (for CPack developers)" },
{ "-P <package name>", "override/define CPACK_PACKAGE_NAME" },
{ "-R <package version>", "override/define CPACK_PACKAGE_VERSION" },
@@ -119,6 +121,8 @@ int main(int argc, char const* const* argv)
bool help = false;
bool helpVersion = false;
bool verbose = false;
+ bool trace = false;
+ bool traceExpand = false;
bool debug = false;
std::string helpFull;
std::string helpMAN;
@@ -154,6 +158,10 @@ int main(int argc, char const* const* argv)
arg.AddArgument("--debug", argT::NO_ARGUMENT, &debug, "-V");
arg.AddArgument("--config", argT::SPACE_ARGUMENT, &cpackConfigFile,
"CPack configuration file");
+ arg.AddArgument("--trace", argT::NO_ARGUMENT, &trace,
+ "Put underlying cmake scripts in trace mode.");
+ arg.AddArgument("--trace-expand", argT::NO_ARGUMENT, &traceExpand,
+ "Put underlying cmake scripts in expanded trace mode.");
arg.AddArgument("-C", argT::SPACE_ARGUMENT, &cpackBuildConfig,
"CPack build configuration");
arg.AddArgument("-G", argT::SPACE_ARGUMENT, &generator, "CPack generator");
@@ -197,6 +205,14 @@ int main(int argc, char const* const* argv)
globalMF.AddDefinition("CMAKE_LEGACY_CYGWIN_WIN32", "0");
#endif
+ if (trace) {
+ cminst.SetTrace(true);
+ }
+ if (traceExpand) {
+ cminst.SetTrace(true);
+ cminst.SetTraceExpand(true);
+ }
+
bool cpackConfigFileSpecified = true;
if (cpackConfigFile.empty()) {
cpackConfigFile = cmSystemTools::GetCurrentWorkingDirectory();
@@ -340,6 +356,10 @@ int main(int argc, char const* const* argv)
<< std::endl);
parsed = 0;
}
+
+ cpackGenerator->SetTrace(trace);
+ cpackGenerator->SetTraceExpand(traceExpand);
+
if (parsed && !cpackGenerator->Initialize(gen, mf)) {
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
"Cannot initialize the generator " << gen