[CMake] How to use FindPackageHandleStandardArgs

Marcel Loose loose at astron.nl
Thu May 14 05:14:57 EDT 2009


Hi Denis,

That's my case as well. I need to find more than one library, and it's
an all or nothing situation. I mean, if any of the libraries I'm
searching for is missing, the package as such cannot be used. So, my
original question still stands:

How should I pass a list of libraries to
find_package_handle_standard_args(), where one or more of the elements
of the list may be YYY-NOTFOUND?

Marcel.

On Thu, 2009-05-14 at 02:07 -0700, Denis Scherbakov wrote:
> 
> > I stumbled on a problem with FindPackageHandleStandardArgs,
> > which
> > probably arises from my misunderstanding of how to properly
> > use it.
> 
> In FIND_PACKAGE_HANDLE_STANDARD_ARGS I inlude only variables that must always be defined in order for a package to function. If some variable can be omitted without any harm - it should not appear FIND_PACKAGE_HANDLE_STANDARD_ARGS.
> 
> Example:
> 
> INCLUDE(FindPackageHandleStandardArgs)
> FIND_PACKAGE_HANDLE_STANDARD_ARGS(GSL DEFAULT_MSG GSL_LIBRARY
> GSL_CBLAS_LIBRARY GSL_INCLUDE_DIR)
> 
> MARK_AS_ADVANCED(GSL_INCLUDE_DIR GSL_LIBRARY GSL_CBLAS_LIBRARY
> GSL_CXX_FLAGS GSL_LINK_DIRECTORIES GSL_CONFIG_EXECUTABLE)
> 
> 
>       



More information about the CMake mailing list