[cmake-developers] [PATCH] Now prints warning when --build is not honored

Ashley Whetter ashley at awhetter.co.uk
Sun Jan 17 11:35:35 EST 2016


As per issue 12641, this patch means that a warning is given when the "--build"
option is ignored.

I'm not sure if you'd want a different error message here.
I feel like it might be better to print something about the fact that "--build"
should be used after the binary tree has been generated,
but I can't think of a good way to word it.

Also this doesn't print a warning when "--build" is used in command mode.
It felt unnecessary.

---
 Source/cmake.cxx | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 8f6b952..27378c9 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -798,6 +798,11 @@ void cmake::SetArgs(const std::vector<std::string>& args,
         this->SetGlobalGenerator(gen);
         }
       }
+    else if (arg.find("--build", 0) == 0)
+      {
+      cmSystemTools::Message("--build is not a valid option when "
+          "generating a project binary tree. Ignoring.", "Warning");
+      }
     // no option assume it is the path to the source
     else
       {
-- 
2.6.4



More information about the cmake-developers mailing list