Commit Graph

22 Commits

Author SHA1 Message Date
Christoph Grüninger 63a4c0af31 FindPkgConfig: Stop processing when REQUIRED package not found (#14381)
Make the behavior similar to find_package.
2014-03-24 08:57:31 -04:00
Daniele E. Domenichelli 453d2b2438 FindPkgConfig: small refactoring 2014-03-17 17:50:35 +01:00
Daniele E. Domenichelli 3df5147043 FindPkgConfig: Extend PKG_CONFIG_PATH using CMake variables (#12926)
Use CMAKE_PREFIX_PATH, CMAKE_FRAMEWORK_PATH, and CMAKE_APPBUNDLE_PATH
cache and environment variables to extend PKG_CONFIG_PATH before calling
pkg-config.

In each of the path in these variables it searches for lib/pkgconfig.
Then, depending on the system, it searches for
lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig (debian) or for
lib64/pkgconfig (other 64 bit unixes). If any of these path is found,
it is appended to the PKG_CONFIG_PATH enviromnent variable.

Add two new arguments to the pkg_check_module and pkg_search_module
macro, NO_CMAKE_PATH and NO_CMAKE_ENVIRONMENT_PATH. The new signature
are therefore:

   pkg_check_modules(<PREFIX> [REQUIRED] [QUIET]
                     [NO_CMAKE_PATH] [NO_CMAKE_ENVIRONMENT_PATH]
                     <MODULE> [<MODULE>]*)
   pkg_search_module(<PREFIX> [REQUIRED] [QUIET]
                     [NO_CMAKE_PATH] [NO_CMAKE_ENVIRONMENT_PATH]
                     <MODULE> [<MODULE>]*)

By default, if CMAKE_MINIMUM_REQUIRED_VERSION is 3.1 or later (in
order to keep compatibility with the previous behavior), or if
PKG_CONFIG_USE_CMAKE_PREFIX_PATH is set, the CMAKE_PREFIX_PATH,
CMAKE_FRAMEWORK_PATH, and CMAKE_APPBUNDLE_PATH cache and environment
variables will be added to pkgconfig search path.

The NO_CMAKE_PATH and NO_CMAKE_ENVIRONMENT_PATH arguments disable this
behavior for the cache variables and the environment variables,
respectively, similarly to the find_package() command.
2014-03-17 09:43:08 -04:00
Daniele E. Domenichelli 49ef91d7a6 FindPkgConfig: restructure documentation and document commands and variables 2014-03-10 18:27:46 +01:00
Christoph Grüninger c53b5cd221 FindPkgConfig: Prefer PKG_CONFIG to find pkg-config (#13175)
If the environment variable PKG_CONFIG is set, use this as the
default pkg-config executable.
2014-02-27 10:29:01 -05:00
Kitware Robot f051814ed0 Convert builtin help to reStructuredText source files
Run the convert-help.bash script to convert documentation:

 ./convert-help.bash "/path/to/CMake-build/bin"

Then remove it.
2013-10-15 14:12:03 -04:00
Kitware Robot 9db3116226 Remove CMake-language block-end command arguments
Ancient versions of CMake required else(), endif(), and similar block
termination commands to have arguments matching the command starting the
block.  This is no longer the preferred style.

Run the following shell code:

for c in else endif endforeach endfunction endmacro endwhile; do
    echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
egrep -z -v 'Tests/CMakeTests/While-Endwhile-' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
2012-08-13 14:19:16 -04:00
Kitware Robot 7bbaa4283d Remove trailing whitespace from most CMake and C/C++ code
Our Git commit hooks disallow modification or addition of lines with
trailing whitespace.  Wipe out all remnants of trailing whitespace
everywhere except third-party code.

Run the following shell code:

git ls-files -z -- \
 bootstrap doxygen.config '*.readme' \
 '*.c' '*.cmake' '*.cpp' '*.cxx' \
 '*.el' '*.f' '*.f90' '*.h' '*.in' '*.in.l' '*.java' \
 '*.mm' '*.pike' '*.py' '*.txt' '*.vim' |
egrep -z -v '^(Utilities/cm|Source/(kwsys|CursesDialog/form)/)' |
egrep -z -v '^(Modules/CPack\..*\.in)' |
xargs -0 sed -i 's/ \+$//'
2012-08-13 14:18:39 -04:00
Rolf Eike Beer 3ea850a502 FindPkgConfig.cmake: fix documented output variable not set (#13125,#13132)
The real fix is from Yury G. Kudryashov while I added the surrounding cleanups.
An additional hint to really get this fixed came from Rex Dieter.
2012-04-15 08:39:51 +02:00
Rolf Eike Beer 27501155c7 FindPkgConfig: support version selection of pkg-config itself 2012-02-18 11:57:38 +01:00
Yury G. Kudryashov 55c3435d88 FindPkgConfig: respect REQUIRED (#12620)
find_package(PkgConfig REQUIRED) now fails if pkg-config is not found.
2012-01-20 08:33:51 -05:00
Todd Gamblin 2cde67a781 Modules: Fix spelling 'To distributed' -> 'To distribute' 2010-08-09 08:48:31 -04:00
Alex Neundorf af3a288e55 -add QUIET keyword to pkgconfig macros
Synced from KDE svn: pkg_check_modules() and pkg_search_module() now
both support a QUIET keyword. When given, no messages will be printed (except the REQUIRED ones)

This also fixes #10469 (confusing output of FindLibXml2.cmake)

Alex
2010-05-08 10:36:42 +02:00
Brad King 940733997a Remove old license from FindPkgConfig.cmake module
This module was contributed under a BSD-like license.  We added CMake's
OSI-approved BSD License on top of it.  With the author's permission,
this commit removes the old license text and puts the author's copyright
notice in the block referring to the new license.
2009-10-05 09:13:29 -04:00
Brad King c4bb9c9d42 Convert CMake find-modules to BSD License
This adds copyright/license notification blocks CMake's find-modules.
Many of the modules had no notices at all.  Some had notices referring
to the BSD license already.  This commit normalizes existing notices and
adds missing notices.
2009-09-28 11:45:50 -04:00
Bill Hoffman 4f44c7875f BUG: fix for bug 6117 pkgconfig 2008-02-07 13:19:38 -05:00
Bill Hoffman 1cfe812f11 BUG: fix for 5722 2007-12-17 21:37:16 -05:00
Bill Hoffman a488c2646c BUG: fix for 6117, fix for second run 2007-12-14 12:51:43 -05:00
Alexander Neundorf 1410eef27a STYLE: fix typo
Alex
2007-08-26 02:42:46 -04:00
Bill Hoffman ff6146334c ENH: better backwards compatibility, and deprecate PKGCONFIG 2006-12-09 15:02:19 -05:00
Bill Hoffman 9b42fff02f ENH: maintain backwards compatibility in UsePkgConfig 2006-11-29 16:12:40 -05:00
Bill Hoffman 3c900bbbd9 ENH: check in new pkgconfig stuff from Enrico Scholz 2006-11-22 13:44:59 -05:00