Bingo.<div><br></div><div>With more than one of *anything* installed, the find modules can only guess. They can never know which one is correct.</div><div><br></div><div>In the presence of exactly one installation of something, the find modules are wonderful.</div>
<div><br></div><div>In the presense of two or more, the find modules suck eggs for half the users (on average).</div><div><br></div><div>When there are multiple matching installations, the developer must specify which one he wants. The way he does that varies from module to module, but it is always do-able by simply setting some cache values to point to the right stuff.<br>
<br></div><div>I view this whole thing as an &quot;already solved&quot; problem: when there are multiple possibilities, arrange your environment such that the one you want is found, or specify it explicitly in your including project.</div>
<div><br></div><div><br></div><div>2 cents,</div><div>David</div><div><br></div><div><br><div class="gmail_quote">On Tue, Aug 3, 2010 at 4:29 AM, Michael Wild <span dir="ltr">&lt;<a href="mailto:themiwi@gmail.com">themiwi@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">How about ditching the whole idea of finding the latest version and just search for un-versioned names? If the user wants something different, she should set PYTHON_EXECUTABLE.<br>

<font color="#888888"><br>
<br>
Michael<br>
</font><div><div></div><div class="h5"><br>
On 3. Aug, 2010, at 7:37 , Michael Hertling wrote:<br>
<br>
&gt; On 07/22/2010 02:17 PM, Marcel Loose wrote:<br>
&gt;&gt; Hi all,<br>
&gt;&gt;<br>
&gt;&gt; That sounds like a good solution. It is probably the cleanest way to<br>
&gt;&gt; solve this controversy. OTOH, it adds two extra keywords that, of<br>
&gt;&gt; course, are not used in existing (now sometimes failing) Find macros.<br>
&gt;&gt; IMHO, solving the issue by changing CMake&#39;s behaviour would be<br>
&gt;&gt; preferable, using a policy to switch between old and new behaviour.<br>
&gt;&gt; However, I can see that not everyone is convinced that that would be the<br>
&gt;&gt; way to go. So yes, NAMES_FIRST and PATHS_FIRST sound OK.<br>
&gt;<br>
&gt; Introducing {NAMES,PATHS}_FIRST options wouldn&#39;t solve the underlying<br>
&gt; problem: In connection with hardcoded versions after the NAMES option,<br>
&gt; the paths do not allow to pick out one of them in a reliable manner.<br>
&gt; Furthermore, one shouldn&#39;t underestimate the ongoing requirement for<br>
&gt; maintenance due to hardcoded versions: Even if there was a maintainer<br>
&gt; who will update a FindPython.cmake within several days, each new minor<br>
&gt; release will bring the need to take action at every user&#39;s site where<br>
&gt; the new release is to be used. However, if one really wants to stick<br>
&gt; to hardcoded version lists - irrespective of 10718 - take a look at<br>
&gt; FindPNG.cmake; it has hardcoded versions, too, but knows a variable<br>
&gt; PNG_NAMES that can be used to set the version list&#39;s head to a user-<br>
&gt; supplied value. So, this undocumented feature allows the user to set<br>
&gt; a preference for what&#39;s being looked up first. Nevertheless, IMO, the<br>
&gt; find modules delivered with CMake should be dynamic and flexible to the<br>
&gt; highest degree.<br>
&gt;<br>
&gt; Regards,<br>
&gt;<br>
&gt; Michael<br>
&gt;<br>
&gt;&gt; On Thu, 2010-07-22 at 13:30 +0200, Michael Wild wrote:<br>
&gt;&gt;&gt; Thanks for reminding me of my old idea ;-)<br>
&gt;&gt; <a href="http://www.cmake.org/pipermail/cmake/2010-May/036993.html" target="_blank">http://www.cmake.org/pipermail/cmake/2010-May/036993.html</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I think that would be the cleanest solution. Extract the loop body<br>
&gt;&gt; into a function and then have two separate loops calling the same<br>
&gt;&gt; function.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Michael<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On 22. Jul, 2010, at 13:19 , David Cole wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; With respect to fixing 10718, *if* we fix it (and that&#39;s a big *if*<br>
&gt;&gt; because<br>
&gt;&gt;&gt;&gt; it&#39;s a sweeping change in behavior with largely unpredictable real<br>
&gt;&gt; world<br>
&gt;&gt;&gt;&gt; consequences), I suggest that we:<br>
&gt;&gt;&gt;&gt; - have both loops in CMake,<br>
&gt;&gt;&gt;&gt; - and that the default behavior remains the same as it is now,<br>
&gt;&gt;&gt;&gt; - and that we activate the new behavior by adding new keyword<br>
&gt;&gt; arguments:<br>
&gt;&gt;&gt;&gt; perhaps NAMES_FIRST and PATHS_FIRST<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; That way, stuff stays the same as it is now unless a &quot;finder&quot;<br>
&gt;&gt; activates it<br>
&gt;&gt;&gt;&gt; explicitly in *new* CMake code.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I&#39;m going to add this as a note to 10718, and a pointer to this<br>
&gt;&gt; whole thread<br>
&gt;&gt;&gt;&gt; if there&#39;s not already one there.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Thanks,<br>
&gt;&gt;&gt;&gt; David Cole<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On Thu, Jul 22, 2010 at 4:36 AM, Michael Wild &lt;<a href="mailto:themiwi@gmail.com">themiwi@gmail.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; On 22. Jul, 2010, at 10:17 , Marcel Loose wrote:<br>
&gt;&gt;&gt;&gt;&gt; [...]<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Hi Michael and others,<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; I mostly agree with what your saying. However, IMHO, you refer to<br>
&gt;&gt; a<br>
&gt;&gt;&gt;&gt;&gt;&gt; &quot;perfect world&quot; situation, where all Find modules properly use<br>
&gt;&gt; VERSION<br>
&gt;&gt;&gt;&gt;&gt;&gt; to specify a version number and do not abuse NAMES for that.<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; I know that the current discussion focuses on FindPython; hence<br>
&gt;&gt; the<br>
&gt;&gt;&gt;&gt;&gt;&gt; subject ;-). However, in the &quot;real world&quot; quite a number of other<br>
&gt;&gt; Find<br>
&gt;&gt;&gt;&gt;&gt;&gt; scripts are shipped as part of the CMake distribution that don&#39;t<br>
&gt;&gt; follow<br>
&gt;&gt;&gt;&gt;&gt;&gt; this &quot;perfect&quot; scheme either.<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; So the real question should be, I guess: Should CMake be fixed by<br>
&gt;&gt;&gt;&gt;&gt;&gt; swapping the paths and names loops in the FindXXX() functions<br>
&gt;&gt; (issue<br>
&gt;&gt;&gt;&gt;&gt;&gt; 10718)? Or should all abusing Find scripts be fixed?<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Best regards,<br>
&gt;&gt;&gt;&gt;&gt;&gt; Marcel Loose.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; My question is more fundamental:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; How do I find the most recent version? Because that is why NAMES is<br>
&gt;&gt; being<br>
&gt;&gt;&gt;&gt;&gt; &quot;abused&quot; in the first place.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Michael<br>
&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br></div>