summaryrefslogtreecommitdiffstats
path: root/Modules/FindPkgConfig.cmake
Commit message (Collapse)AuthorAgeFilesLines
* FindPkgConfig: fix handling of frameworksRolf Eike Beer2020-04-181-0/+37
|
* FindPkgConfig: Unset results when pkg-config is brokenBrad King2020-03-161-3/+18
| | | | Inspired-by: FUJI Goro <goro@fastly.com>
* Merge topic 'FindPkgConfig-scope'Brad King2020-02-251-0/+6
|\ | | | | | | | | | | | | c3e0d1ffe9 FindPkgConfig: set policies CMP0054 and CMP0057 to new Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4388
| * FindPkgConfig: set policies CMP0054 and CMP0057 to newRolf Eike Beer2020-02-241-0/+6
| | | | | | | | | | | | One may encounter warnings if FindPkgConfig is used in any project, even indirectly, that has set any of these policies to old explicitely or requires an older version.
* | FindPkgConfig: Fix path manipulations when cross compilingHugo Beauzée-Luyssen2019-12-021-1/+1
|/ | | | | | When cross compiling from a unix machine, if(UNIX) is false, whih causes the path not to be fixed for unix, leading to false negative if PKG_CONFIG_PATH needs to be probed
* FindPkgConfig: Allow libraries that can't be found with their full pathChuck Atkins2019-09-161-1/+5
| | | | | | | | | | | | pkg-config's .pc files can sometimes provide libraries that are visible to the linker but not present in CMake's known search paths. In the case where CMake can find some, but not all of the library dependencies provided in a .pc file, this allows them to be passed through as "-lfoo" when the full path can't be found. This also removes the test failure cases that occured because of this scenario and adjsuts the remaining tests to account for not-found libraries
* FindPkgConfig: return the module found by pkg_search_moduleChristophe Giboudeaux2019-08-291-0/+7
| | | | | | | | | | When running `pkg_search_module`, it may be useful to get the matching module name in order to run `pkg_get_variable`. `pkg_search_module` now defines `<prefix>_MODULE_NAME` which contains the first matching module name. Fixes: #19648
* pkg_get_variable now sets PKG_CONFIG_PATH like pkg_check_modulesDan Kegel2019-03-201-24/+34
| | | | Fixes: #15805
* FindPkgConfig: hoist PKG_CONFIG_PATH ops out into _pkg_set_path_internalDan Kegel2019-03-201-89/+98
|
* FindPkgConfig: Set linker flags on imported targetsRadek Nadstawny2019-03-131-1/+5
|
* PkgConfig: Be less verbose by mark(ing)_as_advanced the find_library resultSylvain Joubert2018-11-071-0/+1
|
* Help: Override pygments CMakeLexer to support <..> and [..]Joachim Wuttke (o)2018-10-181-10/+16
| | | | | | | | | | | | | | | | | | | | | | * The code snippets in the docs consist of CMake code mixed with syntax definition punctuation like < > [ ] ... Therefore a pure CMake lexer is inadequate. Here it is replaced by a CMake syntax definition parser. * Fixed syntax definition snippets in FindPkgConfig.cmake to make best use of syntax highlighting. This source file is the hardest to support because it contains comparison operators <= = >=, which need special attention to avoid confusion with the placeholder indicators <...>. * Fixed syntax in execute_process.rst (there were unbalanced brackets). * Disabled syntax highlighting for long string examples in cmake-language.7.rst. * No highlighting of removed syntax in CMP0049 * To inspect the outcome of this patch, see e.g. the pages * manual/cmake-buildsystem.7.html * module/ExternalProject.html * module/FindPkgConfig.html which are particularly rich in complex code snippets.
* Help: Use appropriate list types in FindPkgConfigJoachim Wuttke (l)2018-10-171-27/+42
|
* FindPkgConfig: Document support for > and < operatorsCraig Scott2018-10-151-6/+9
| | | | | This was left out of commit v3.13.0-rc1~14^2 (FindPkgConfig: support also > and < operators for version compares, 2018-10-02).
* FindPkgConfig: support also > and < operators for version comparesRolf Eike Beer2018-10-041-1/+3
| | | | Fixes: #18416
* FindPkgConfig: allow to create global imported targetsRolf Eike Beer2018-07-221-16/+31
|
* FindPkgConfig: export the list of found libraries also as variableRolf Eike Beer2018-05-111-12/+27
|
* FindPkgConfig: correct library search path for imported targets.Aleksandr Mezin2018-05-011-2/+6
| | | | | | | | | | | | | | `-L` in LDFLAGS doesn't mean that standard search paths should be excluded. Example: $ pkg-config --libs libmutter-2 -L/usr/lib/mutter -lmutter-2 -lgtk-3 -lgdk-3 -lmutter-clutter-2 -lcairo-gobject -latk-1.0 -lpangocairo-1.0 -lpango-1.0 -lfribidi -ljson-glib-1.0 -lgio-2.0 -lwayland-egl -lwayland-client -lXtst -lXi -lmutter-cogl-2 -lcairo -lgmodule-2.0 -pthread -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lgbm -ldrm -lwayland-server -lEGL -lXext -lXdamage -lXfixes -lXcomposite -lXrandr -lX11 Most of these libraries are located at standard paths, not in `/usr/lib/mutter`. Fixes: #17954
* FindPkgConfig: do not unset unused variableRolf Eike Beer2018-04-241-1/+0
| | | | _props is never used, it was a leftover from a development step.
* FindPkgConfig: Fix IMPORTED_TARGET NO...PATH option handlingCraig Scott2017-12-161-5/+5
|
* FindPkgConfig: Cleanup docsCraig Scott2017-12-101-125/+126
| | | | | | - Moved block of misplaced comments to correct section - Improved grammar, readability and consistency - Updated to conform to style guidelines
* FindPkgConfig: On FreeBSD search in `libdata/pkgconfig`Shin-ya Murakami2017-08-071-0/+3
| | | | | | The pkgconfig dir is placed at `${PREFIX}/libdata/pkgconfig` on FreeBSD instead of `${PREFIX}/lib/pkgconfig`, where `${PREFIX}` is `/usr/local` as default.
* FindPkgConfig: do not always rerun pkg_check_modules() with 2 argumentsRolf Eike Beer2017-07-101-1/+3
| | | | | | | | | | | | | | Since commit v3.8.0-rc1~47^2 (FindPkgConfig: Recheck pkg-config on parameter change, 2017-01-17) calling `pkg_check_modules` always re-runs. The problem is that if there are only 2 arguments passed to `pkg_check_modules```, then `_module0` will be set and `ARGN` will be empty. When this is written to cache it will be stored as just the value of `_module0` without any semicolon, so on the next run this doesn't match the expected value and the search is rerun. Revise the logic to handle the case of empty `ARGN` separately. Fixes: #17003
* FindPkgConfig: mention that variables will be ;-listsRolf Eike Beer2017-06-121-0/+6
|
* FindPkgConfig: fix confusing indentationRolf Eike Beer2017-06-121-1/+1
|
* FindPkgConfig: Fix pkg_check_modules() non-standard location searchYuriy Khokhulya2017-05-121-1/+3
| | | | | | | | | | | | | | | | | During search of the library file `pkg_check_modules()` attempts to find it in last specified library path in `${_prefix}_LDFLAGS`, that after dependency resolving contains path to standard location. So in case when `${_prefix}_LDFLAGS` has: -L/prefix;-L/usr/local/lib;-llibrary_from_prefix;-ldependency `library_from_prefix` will not be found. As solution need try to find the library in all paths preceding to the library. Fixes: #16873
* Add support for x32-abiSteven Newbury2017-03-071-0/+4
| | | | | | | | Detect x32-abi through CMakeCompilerABI infrastruture and use this information at runtime to determine the correct library paths with `FIND_LIBRARY_USE_LIBX32_PATHS`. Fixes: #15994
* FindPkgConfig: use new version checking "library >= version" syntaxGautier Pelloux-Prayer2017-02-281-24/+11
| | | | Instead of the deprecated --atleast-version one.
* FindPkgConfig: Recheck pkg-config on parameter change.Matthew Hanna2017-01-251-1/+4
| | | | | | | | | Currently, once pkg_check_modules succeeds, it will never call _pkg_check_modules_internal again. That means that if the parameters to pkg_check_modules are changed, cmake will be called to reconfigure, but nothing will change. This change is to store the full string of arguments to pkg_check_modules and override the FOUND optimization so that the arguments are reevaluated when modified.
* FindPkgConfig: Fix missing error text when library version is specifiedGautier Pelloux-Prayer2016-11-281-1/+2
| | | | | | Calls like `pkg_check_modules(somelibrary>=3.22)` that specify a version requirement should still display an informative error when the package is not found. Fix our logic accordingly.
* PkgConfig: Fix FindPkgConfig imported target featureFlorent Castelli2016-11-041-1/+1
| | | | | | | The options to the find_library call to create the imported target used a literal string "HINTS /path NO_DEFAULT_PATH" instead of a list of options. This resulted in never finding any library in my testing.
* Simplify CMake per-source license noticesBrad King2016-09-271-16/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* Use string(APPEND) in ModulesDaniel Pfeifer2016-07-271-1/+1
| | | | | | | Automate with: find Modules -type f -print0 | xargs -0 perl -i -0pe \ 's/set\(([a-zA-Z0-9_]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
* Merge topic 'pkgconfig-targets'Brad King2016-06-201-2/+6
|\ | | | | | | | | 8345c646 FindPkgConfig: define the imported targets also when the data comes from cache
| * FindPkgConfig: define the imported targets also when the data comes from cacheRolf Eike Beer2016-06-191-2/+6
| |
* | Teach find_library and find_package to search lib32 paths (#11260)Daniel Scharrer2016-06-101-2/+6
|/ | | | | | | Add a ``FIND_LIBRARY_USE_LIB32_PATHS`` global property analogous to the ``FIND_LIBRARY_USE_LIB64_PATHS`` property. This helps find commands on multilib systems that use ``lib32`` directories and either do not have ``lib`` symlinks or point ``lib`` to ``lib64``.
* FindPkgConfig: optionally create imported target for the found librariesRolf Eike Beer2016-05-141-6/+76
|
* FindPkgConfig: set correctly named variables in cache (#15903)Ben Boeckel2016-03-211-1/+1
| | | | | | | | | | The fix in commit v3.5.0-rc1~27^2 (FindPkgConfig: set standard variables in the cache, 2016-01-20) added the wrong variable name to the cache. The test was only testing that the cache variable existed, not that it also had the correct value. Update the test to ensure that the cache value matches the local variable value. Reported-by: Bernd Lörwald
* FindPkgConfig: set standard variables in the cacheBen Boeckel2016-01-211-0/+3
| | | | | | | | | Fixes a regression introduced when the code was simplified to use the variable queries. Fixes #15903. Reported-by: Bernd Lörwald
* FindPkgConfig: Quote ${_pkgconfig_path} to protect semicolons on WindowsRob Gowin2016-01-191-4/+4
|
* FindPkgConfig: Fix restoration of PKG_CONFIG_PATH in environmentRob Gowin2016-01-151-1/+1
| | | | | | The original value is saved in `_pkg_config_path_old`. Fix this typo left by commit v3.1.0-rc1~763^2 (FindPkgConfig: Extend PKG_CONFIG_PATH using CMake variables, 2014-03-06).
* FindPkgConfig: add PREFIX/share/pkgconfig to PKG_CONFIG_PATH (#15910)Sam Thursfield2016-01-121-0/+1
| | | | | | | | | | Most packages install their .pc files into PREFIX/lib/pkgconfig, but some put them into PREFIX/share/pkgconfig. Either is valid, and pkg-config itself looks in both for the /usr and /usr/local prefixes. This fixes an issue where some packages (yajl, for example) are not found if they are installed into a non-standard prefix and CMAKE_PREFIX_PATH is used to locate them.
* FindPkgConfig: return actual error when a package is not found (#15810)Benjamin Chrétien2015-10-281-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some cases, CMake returned the following error: -- Checking for module 'foo' -- Package 'foo' not found When the actual error returned by pkg-config was: Package 'bar', required by 'foo', not found Now, the actual error is forwarded to the user. -- Checking for module 'foo' -- Package 'bar', required by 'foo', not found For the standard case (i.e. the package was indeed not found), the CMake error was: -- Checking for module 'foo' -- Package 'foo' not found But it now prints: -- Checking for module 'foo' -- No package 'foo' found The associated test was also updated. ${last} refers to the last CLI argument.
* FindPkgConfig: add a command to query arbitrary variablesBen Boeckel2015-09-211-3/+23
|
* FindPkgConfig: use execute_process to strip trailing whitespaceBen Boeckel2015-09-181-2/+2
|
* FindPkgConfig: remove variable dereferenceRolf Eike Beer2015-08-181-1/+1
| | | | | | | | | | | | | | | | | | If CMAKE_MINIMUM_REQUIRED_VERSION is not set because no cmake_minimum_required() call is present this line can lead to an error as that string is empty so too few arguments are passed to if(): See also "/var/tmp/paludis/build/kde-krdc-15.08.0/work/build/CMakeFiles/CMakeOutput.log". See also "/var/tmp/paludis/build/kde-krdc-15.08.0/work/build/CMakeFiles/CMakeError.log". CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:112 (elseif): given arguments: "VERSION_LESS" "3.1" Unknown arguments specified Call Stack (most recent call first): /usr/share/cmake/Modules/FindPkgConfig.cmake:501 (_pkgconfig_parse_options) /usr/share/cmake/Modules/FindOpenSSL.cmake:43 (pkg_check_modules)
* FindPkgConfig: Capitalize first letter of all message()sChristopher Meng2015-08-121-5/+5
| | | | | This makes FindPkgConfig output more formal and more consistent with many other messages produced by CMake.
* FindPkgConfig: Fix extra paths for CMAKE_{FRAMEWORK,APPBUNDLE}_PATH varsDaniele E. Domenichelli2015-05-291-1/+1
| | | | | | | | The CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH cache variables are supposed to be used to generate the extra paths passed to pkg-config, but instead the CMAKE_PREFIX_PATH variable is used. This bug was introduced by the refactor in commit v3.1.0-rc1~747^2~1.
* Modules: Check for ARGC before using ARGV#Daniele E. Domenichelli2015-02-271-1/+1
| | | | ARGV# could be defined from a parent scope.
* Modules: Wrap long lines in pre-formatted documentation blocksBrad King2014-11-061-3/+4
| | | | Help format the blocks better for display without a wide screen.