summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CMakeLists.txt
diff options
context:
space:
mode:
authorDaniele E. Domenichelli <daniele.domenichelli@iit.it>2014-03-06 17:55:04 (GMT)
committerBrad King <brad.king@kitware.com>2014-03-17 13:43:08 (GMT)
commit3df5147043d83aa09acd5c9ce31d5c602efb99db (patch)
treeffae904e4f825090443b49fc6f25a0e541709886 /Tests/RunCMake/CMakeLists.txt
parent49ef91d7a6dc75b5bbc7a6b06ed909b23d13fd72 (diff)
downloadCMake-3df5147043d83aa09acd5c9ce31d5c602efb99db.zip
CMake-3df5147043d83aa09acd5c9ce31d5c602efb99db.tar.gz
CMake-3df5147043d83aa09acd5c9ce31d5c602efb99db.tar.bz2
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.
Diffstat (limited to 'Tests/RunCMake/CMakeLists.txt')
-rw-r--r--Tests/RunCMake/CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index d401a93..c7091d6 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -106,6 +106,11 @@ if (QT4_FOUND)
add_RunCMake_test(ObsoleteQtMacros)
endif()
+find_package(PkgConfig QUIET)
+if(PKG_CONFIG_FOUND)
+ add_RunCMake_test(FindPkgConfig)
+endif()
+
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio [^6]")
add_RunCMake_test(include_external_msproject)
add_RunCMake_test(SolutionGlobalSections)