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

2016-01-19 Thread Brad King
On 01/17/2016 11:35 AM, Ashley Whetter wrote:
> As per issue 12641, this patch means that a warning is given when the 
> "--build"
> option is ignored.

Thanks for working on this.

> I'm not sure if you'd want a different error message here.

Ideally all unused arguments would get a warning but that will take significant
refactoring of how arguments are stored and passed around internally.

> 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.

How about:

  Ignoring option '--build' because it is meant to be used only
  to drive an already-generated project build system.

?

Please also add a test somewhere in Tests/RunCMake for this.

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2016-01-17 Thread Ashley Whetter
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& 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

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers