[CMake] FIND_* search paths

William A. Hoffman billlist at nycap.rr.com
Thu Jan 5 08:50:02 EST 2006


At 07:23 PM 1/4/2006, E. Wing wrote:
>So what is the default going to do if you omit (forget) specifying the
>CMAKE_SYSTEM_*_DIRECTORIES? This will probably be the common case (for
>legacy scripts, people not in the loop on the new feature).
>

It will keep doing what it has been doing.

>For custom/internal use scripts, these new variables seem reasonable,
>but for public/general consumption scripts (e.g. the Find*.cmake
>scripts in the Modules directory), I think these just pass the buck of
>the search order problem from CMake to the CMake scripters without
>really solving anything. So I think a good default is needed
>(particularly in the case of omission) and perhaps a user-configurable
>switch is also needed.

I would update all the modules in the Modules directory to use the new variables.

>My personal approach to public modules is to throw in everything that
>I know exists for the major platforms/distributions I know about. My
>intent is to make it very easy for a newbie to get going in one step
>if possible. (In fact, most of my colleagues don't have the patience
>to want to learn or setup a CMake build system so I can't make it more
>than one easy step before I lose them.) Most of the time I can't know
>what their desired search order is (though I can make some guesses
>with things like OS X frameworks since generally you have to go out of
>your way to get a framework).

The Mac is the biggest problem OS, as it essentially has two
installs of almost everything.  It has a framework Carbon/Coco 
version and an X11 unix style version.   In the past all the find stuff
always searched the listed directories first, but this becomes a problem
on the Mac because they are usually listed for UNIX and not frameworks.
So, it was requested that for the Mac we make an exception and do not
put the users specified list first.   This becomes problematic because then,
there becomes no way to change the order on the Mac.  If you do not want
the framework version of something, you are out of luck!  Which seems to
be a worst condition than the one we currently have.   Also, for the most
part the search directories should be the same for FIND_* calls, and users
should not have to repeat /usr/local over and over in each call.

So, I am open to ideas/uses cases on how to fix the problem.  Here
are the constraints as I see it:

1. We want existing and future Find*.cmake files to work on the 
Mac without being Mac specific.

2.  It is not good for each Find*.cmake thing to list its own system paths, and
we should put more of this search information into the Platform files.

3. The FIND_* stuff should be able to override cmake default paths and remain
backwards compatible if possible, and still work on the split personality MACs!

-Bill




More information about the CMake mailing list