[cmake-developers] [PATCH 0/3] FindwxWidgets improvements

Rolf Eike Beer eike at sf-mail.de
Tue Jan 19 15:44:52 EST 2016


Am Dienstag, 19. Januar 2016, 14:25:15 schrieb Brad King:
> On 09/09/2015 11:01 AM, Brad King wrote:
> >  FindwxWidgets: allow specifying required version
> >  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6089fde5
> 
> This introduced a regression reported here:
> 
>  https://cmake.org/Bug/view.php?id=15928
> 
> The version extraction from the header is breaking the reported case.
> 
> > + find_file(_filename wx/version.h PATHS ${wxWidgets_INCLUDE_DIRS}
> > NO_DEFAULT_PATH)
> This call is affected by CMAKE_FIND_ROOT_PATH.  Please take a look.

A random collection of thoughts I have on this:

-"_filename" is a bad name for something that is find_* set in any module. 
Really. Since the value is also in the cache with older CMake releases I think 
this name is also used at another place, so here is not searched at all or so.

-reading with file(STRINGS) will put much less stuff in the list that is REGEX 
REPLACEd later, which is probably much more efficient (depending on how large 
the file is)

-maybe call to find_file can be omitted at all, and instead just FOREACH loop 
over the include dirs and simply if(EXISTS) check if the header is there

Eike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20160119/35f8963a/attachment.sig>


More information about the cmake-developers mailing list