Re: [cmake-developers] Integration of clang-tidy

2016-04-26 Thread Daniel Pfeifer
On Mon, Apr 11, 2016 at 5:26 PM, Brad King  wrote:
> On 04/08/2016 06:31 PM, Daniel Pfeifer wrote:
>> I implemented the integration of `clang-tidy` along the lines of the
>> `include-what-you-use` integration.
>> There is a new `_CLANG_TIDY` target property that is initialized
>> with the value of the `CMAKE__CLANG_TIDY` variable.
>> It contains the command line for `clang-tidy` as a ;-list.
>
> Nice.  The patch is very complete.  Applied:
>
>  Add options to run clang-tidy with the compiler
>  https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b2db0170

This is a follow up patch:

Clang-Tidy writes the number of warnings, the number of suppressed
warnings, and instructions on how to suppress warnings to stderr.  Since
each source file is checked individually, this repetitive information is
disturbing and should be suppressed.

The actual warning messages are written to stdout.  Some IDEs (eg.
QtCreator) analyze only stderr for issues.  Redirecting Clang-Tidy's
stdout to stderr makes sure the warnings are correctly displayed.
From 53dc5b84eb6e39a6dac6eb8fab13dcf92d04ed35 Mon Sep 17 00:00:00 2001
From: Daniel Pfeifer 
Date: Tue, 26 Apr 2016 22:50:54 +0200
Subject: [PATCH] Clang-Tidy: copy stdout to sterr; ignore original stderr

Clang-Tidy writes the number of warnings, the number of suppressed
warnings, and instructions on how to suppress warnings to stderr.  Since
each source file is checked individually, this repetitive information is
disturbing and should be suppressed.

The actual warning messages are written to stdout.  Some IDEs (eg.
QtCreator) analyze only stderr for issues.  Redirecting Clang-Tidy's
stdout to stderr makes sure the warnings are correctly displayed.
---
 Source/cmcmd.cxx | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 3c28c35..e9edac4 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -387,15 +387,19 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args)
 cmSystemTools::ExpandListArgument(tidy, tidy_cmd, true);
 tidy_cmd.push_back(sourceFile);
 tidy_cmd.push_back("--");
-tidy_cmd.insert(tidy_cmd.end(), orig_cmd.begin()+1, orig_cmd.end());
+tidy_cmd.insert(tidy_cmd.end(), orig_cmd.begin(), orig_cmd.end());
 
-// Run the tidy command line.
-if(!cmSystemTools::RunSingleCommand(tidy_cmd, 0, 0, , 0,
-cmSystemTools::OUTPUT_PASSTHROUGH))
+// Run the tidy command line.  Capture its stdout and hide its stderr.
+std::string stdOut;
+if(!cmSystemTools::RunSingleCommand(tidy_cmd, , 0, , 0,
+cmSystemTools::OUTPUT_NONE))
   {
   std::cerr << "Error running '" << tidy_cmd[0] << "'\n";
   return 1;
   }
+
+// Output the stdout from clang-tidy to stderr
+std::cerr << stdOut;
 }
 
   // Now run the real compiler command and return its result value.
-- 
2.8.0

-- 

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] [CMake 0016083]: ExternalProject with empty GIT_SUBMODULES does not initialize submodules of submodules

2016-04-26 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
https://cmake.org/Bug/view.php?id=16083 
== 
Reported By:Ilya
Assigned To:
== 
Project:CMake
Issue ID:   16083
Category:   CMake
Reproducibility:always
Severity:   minor
Priority:   normal
Status: new
== 
Date Submitted: 2016-04-26 17:13 EDT
Last Modified:  2016-04-26 17:13 EDT
== 
Summary:ExternalProject with empty GIT_SUBMODULES does not
initialize submodules of submodules
Description: 
Current implementation uses the following command to get submodules:

1. `git submodule init`
2. `submodule update --recursive`

This is enough to initialize direct submodules of the repo, however it leaves
submodules of submodules uninitialized.

To address this, [2] (and possibly [1]) must be changed to `submodule update
--recursive --init`

Steps to Reproduce: 
1. Add an external project that has submodule which has its own submodule
2. Try to pull sources of this project
3. Check that submodule of submodule was not initialized
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2016-04-26 17:13 Ilya   New Issue
==

-- 

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] [CMake 0016082]: Support alternative download URL in ExternalProject_Add

2016-04-26 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
https://public.kitware.com/Bug/view.php?id=16082 
== 
Reported By:A. Klitzing
Assigned To:
== 
Project:CMake
Issue ID:   16082
Category:   CMake
Reproducibility:always
Severity:   minor
Priority:   normal
Status: new
== 
Date Submitted: 2016-04-26 09:04 EDT
Last Modified:  2016-04-26 09:04 EDT
== 
Summary:Support alternative download URL in
ExternalProject_Add
Description: 
We use a script with a lot of ExternalProject_Add to generate our dependencies.
But some project moves their files to different destination after some time. For
example: openssl

It would be very helpful if ExternalProject_Add could support alternative
download URLs as a list. So cmake could try the next URL if a connection error
occurs.

ExternalProject_Add(dummy
URL "${FIRST_URL}" "${SECOND_URL}" "${THIRD_URL}"
)


Additional Information: 
OpenSSL:

Current version:
ftp://ftp.openssl.org/source/

If a new version arrives the old one will be moved to:
ftp://ftp.openssl.org/source/old/

== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2016-04-26 09:04 A. KlitzingNew Issue
==

-- 

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