[CMake] Question about find_library()

Philip Lowman philip at yhbt.com
Thu Mar 26 22:55:27 EDT 2009


On Thu, Mar 26, 2009 at 10:23 PM, Robert Dailey <rcdailey at gmail.com> wrote:

> I'm assuming that the macro in question will automatically mark all cache
> variables as advanced. Is this the case?
>
> @Mike Jackson
> Thank you for this info. I forgot about that function.
>
> There seems to be an inconsistency in naming convention. For example, the
> set() function uses the term INTERNAL to represent a "hidden" cache
> variable. However, the function mark_as_advanced() is using the term
> "advanced". What I would like to see is one of the following pairs:
>
> set( CACHE ADVANCED )
> mark_as_advanced()
>
>  - OR -
>
> set( CACHE INTERNAL )
> mark_as_internal()
>
> Does this make sense, or am I misunderstanding the difference between the
> two?
>

You can consider INTERNAL "super advanced".  It won't get shown in the cache
editor at all.  I think if you want an internal cache variable it probably
should be created as an INTERNAL.  In general you probably want to avoid
using INTERNAL unless you really need it.  Think of INTERNAL as a friendlier
way to use set(...FORCE CACHE).  Basically you're setting a cache variable
you want to be persistent, but you don't want to confuse the user into
thinking they have a choice in changing it.

Marking a variable as advanced is more of a discretionary thing.  Generally
when writing a find module a good rule of thumb is do not mark_as_advanced()
by default.  Generally, leave the user calling find_package() to do this and
assume they care about the location of the library.

HTH

-- 
Philip Lowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090326/04934d3f/attachment.htm>


More information about the CMake mailing list