How about IN_RANGE and/or IN_SET options? Where IN_RANGE takes two version numbers (low and high) and does the equivalent of:
if ( (NOT ver VERSION_LESS low) AND (ver VERSION_LESS high) ) Or possibly even IN_RANGES with multiple ranges... And IN_SET takes a list of explicit version numbers and looks for exact matches among multiple choices...? It's all pie in the sky until you reach up and pull one down. ;-) D On Fri, Oct 3, 2014 at 3:35 AM, Rolf Eike Beer <e...@sf-mail.de> wrote: > find_package(foo 2.0 EXACT) means EXACT, i.e. only "2.0" is allowed. In most > cases this behavior is not the one that one would expect or need. Most people > would instead allow any 2.0.x version to match. This sort of selection is > currently impossible without additional effort in every Find*.cmake that is > used. > > I came over this when I tried converting FindLua5[01].cmake to use > FindLua.cmake, but I can't do "find_package(Lua 5.0 EXACT)" in there because > e.g. 5.0.1 would not be accepted then, and I neither can do "find_package(Lua > 5.0)" because that may return e.g. 5.2 instead. > > Since we can't change this because of the usual backward compatibility > concerns I think we should introduce a new version mode, e.g. EXACT_OR_MINOR > (or any other naming you find more appropiate). > > In case this is aggreed on I would try to create a patch ASAP to be able to > still land it in 3.1. > > Opinions? > > Eike > -- > > 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 -- 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