summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2012-09-19 21:50:55 +0200
committerBrad King <brad.king@kitware.com>2012-09-28 09:21:36 -0400
commitae4ab62569e9b68d6976cb6ad4c1ad411ed8d3da (patch)
tree69711064b311c88731288d0f556a4bb15813ae86 /Modules
parent6508a8c804264304ee9db4e9239857fa1c663989 (diff)
downloadcmake-ae4ab62569e9b68d6976cb6ad4c1ad411ed8d3da.tar.gz
find_package: add support for a <package>_NOT_FOUND_MESSAGE variable
If a config-file sets <package>_FOUND to FALSE, it can now give a reason using the variable <package>_NOT_FOUND_MESSAGE, which is used by cmFindPackage and FPHSA. Alex
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindPackageHandleStandardArgs.cmake3
-rw-r--r--Modules/readme.txt3
2 files changed, 6 insertions, 0 deletions
diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake
index 888e1097a1..25d8df39fe 100644
--- a/Modules/FindPackageHandleStandardArgs.cmake
+++ b/Modules/FindPackageHandleStandardArgs.cmake
@@ -120,6 +120,9 @@ macro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
list(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version)
set(configsText "${configsText} ${filename} (version ${version})\n")
endforeach()
+ if (${_NAME}_NOT_FOUND_MESSAGE)
+ set(configsText "${configsText} Reason given by package: ${${_NAME}_NOT_FOUND_MESSAGE}\n")
+ endif()
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}")
else()
diff --git a/Modules/readme.txt b/Modules/readme.txt
index ab5eaa1eb8..4818031d71 100644
--- a/Modules/readme.txt
+++ b/Modules/readme.txt
@@ -18,6 +18,9 @@ XXX_VERSION_YY Expect Version YY if true. Make sure at most one of thes
XXX_WRAP_YY If False, do not try to use the relevent CMake wrapping command.
XXX_YY_FOUND If False, optional YY part of XXX sytem is not available.
XXX_FOUND Set to false, or undefined, if we haven't found, or don't want to use XXX.
+XXX_NOT_FOUND_MESSAGE Should be set by config-files in the case that it has set XXX_FOUND to FALSE.
+ The contained message will be printed by the find_package() command and by
+ find_package_handle_standard_args() to inform the user about the problem.
XXX_RUNTIME_LIBRARY_DIRS Optionally, the runtime library search path for use when running an executable linked to shared libraries.
The list should be used by user code to create the PATH on windows or LD_LIBRARY_PATH on unix.
This should not be a cache entry.