[CMake] FIND_PATH issue in FindQt4.cmake

Andreas Pakulat apaku at gmx.de
Tue Feb 15 13:23:00 EST 2011


On 15.02.11 06:34:07, Harinarayan Krishnan wrote:
> Hi All,
> 
> Thanks for the help so far, I will check and see if CMake 2.8.4rc has the
> same issue meanwhile I noticed that FIND_PATH seems to have special
> instructions for Darwin machines with the use of CMAKE_FIND_FRAMEWORK on
> page http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:find_path
> 
> The notes are a little confusing: it says CMAKE_FIND_FRAMEWORK defaults to
> "FIRST" on Darwin systems which I can interpret one of two ways.
> 
> First, If a standard library and a framework are found in the same search
> order then CMAKE will use this variable to determine which to pick first.
> 
> Second, if a framework is found regardless of where it is in the search
> order it will be picked. I suspect the choice is the first one. However, in
> my test I found that if I set CMAKE_FIND_FRAMEWORK to be "LAST" then CMAKE
> picks the proper path. This would make me think the second option is at play
> or it is just pure coincidence that this option happened to give me the
> correct result.
> 
> Any of you know what the correct option is? To me it would make sense that
> FIND_PATH honors the search order which would mean that the HINTS option in
> FindQt4 should have higher precedence than the Framework in the
> CMAKE_SYSTEM_FRAMEWORK_PATH.

This cannot be answered without looking at the source code (as its not
documented properly) to check what exactly the algorithm does. That is
wether it iterates of the individual path in each of the steps and then
checks for framework and afterwards for standard headers in that path or
if it first checks all paths in a step for frameworks and then again
checks all paths for standard headers. Depending on which of the two it
is, the outcome of a find_path may depend on the order of the input
path-variables (like CMAKE_PREFIX_PATH) or not.

Andreas

-- 
You are the only person to ever get this message.


More information about the CMake mailing list