On 2 Jan 2014, at 14:13 , Matt Wilbur <[email protected]> wrote:

> I am a CMake newbie (like, just this week), and this is only a partial 
> solution (I think I could probably flesh it out if we knew what the version 
> string would look like in all situations), but maybe something like this:

find_package will always fail to find clang-format because there is no cmake 
module for this.

It turns out that there is fairly simple way to find it though:

find_program(CLANG_FORMAT NAMES clang-format clang-format-3.6 clang-format-3.5 
clang-format-3.4)

This picks the first match in the list of names, which is just what I need. 
It's not totally generic because,
when a new version of clang-format is released, the command needs updating. But 
that's
acceptable for me.

Cheers,

Michi. 
--

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://www.cmake.org/mailman/listinfo/cmake

Reply via email to