[CMake] Re: [ANN] New PkgConfig module
Maik Beckmann
maikbeckmann at gmx.de
Wed Nov 1 09:41:11 EST 2006
> rather than
> > LIBNAME_INCLUDE_DIRS and
> > LIBNAME_LINK_LIBS ...
>
> afais, the latter naming convention is required by Modules/readme.txt
Oh, didn't know.
> first:
> > pkg_config(MYPREFIX found "lib1 >= ??? lib2 >= ??? ...")
> > if(NOT found)
> > # FATAL_ERROR of looking for alternatives ...
> > ...
> > if(NOT MYPREFIX_FOUND)
> > # FATAL_ERROR of looking for alternatives ...
>
> I think, both are possible at the same time. But by implementing the
> first variant you will run into the used-variables problem ('found'
> might be used by the local CMakeLists.txt already).
"found" is provided by the user at the local CMakeLists.txt.
There is no need to check it to be used already, since a pkg_check_modules will use it by
set( ${pkg_check_modules_name_for_the_second_argument} 1)
> good idea; but how do you protect the global
> 'PKGCONFIG_PRIVATE_list_of_used_vars' variable?
I can't. It has to be mentioned in the module docs that the
PKGCONFIG_PRIVATE or whatever prefix must not be used!
My approach is for making it save to use short variable names like
"from" or "to".
Brad mentioned using "_" as a prefix should be enough. But what about
module authors who uses other modules? The modules may "_"-prefix the
same variable name, i.e. "_to".
More information about the CMake
mailing list