diff options
author | Brad King <brad.king@kitware.com> | 2008-03-17 15:10:42 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-03-17 15:10:42 (GMT) |
commit | 7a888b68daa674690088f0beaf1a83fa8e409138 (patch) | |
tree | bc21d74ec3f7bcf2ceba288da2cf0610f5fcfff1 /Modules/FindPackageHandleStandardArgs.cmake | |
parent | 98e06794dd2b4554e1fc82314edc9a5c7a232d7d (diff) | |
download | CMake-7a888b68daa674690088f0beaf1a83fa8e409138.zip CMake-7a888b68daa674690088f0beaf1a83fa8e409138.tar.gz CMake-7a888b68daa674690088f0beaf1a83fa8e409138.tar.bz2 |
ENH: Added FindPackageMessage module
- Defines FIND_PACKAGE_MESSAGE function to help display
find result messages only once
- Added use of it to FindPackageHandleStandardArgs
- Added use of it to FindQt4, and FindX11
- This cleans up repeated messages in big projects
Diffstat (limited to 'Modules/FindPackageHandleStandardArgs.cmake')
-rw-r--r-- | Modules/FindPackageHandleStandardArgs.cmake | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake index 20d830c..091954f 100644 --- a/Modules/FindPackageHandleStandardArgs.cmake +++ b/Modules/FindPackageHandleStandardArgs.cmake @@ -17,6 +17,7 @@ # be "Could NOT find LibXml2", if you don't like this message you can specify # your own custom failure message there. +INCLUDE(FindPackageMessage) FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 ) IF("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG") @@ -27,22 +28,25 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 ) STRING(TOUPPER ${_NAME} _NAME_UPPER) + SET(DETAILS "") SET(${_NAME_UPPER}_FOUND TRUE) IF(NOT ${_VAR1}) SET(${_NAME_UPPER}_FOUND FALSE) + ELSE(NOT ${_VAR1}) + SET(DETAILS "${DETAILS}[${${_VAR1}}]") ENDIF(NOT ${_VAR1}) # check if all passed variables are valid FOREACH(_CURRENT_VAR ${ARGN}) IF(NOT ${_CURRENT_VAR}) SET(${_NAME_UPPER}_FOUND FALSE) + ELSE(NOT ${_CURRENT_VAR}) + SET(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]") ENDIF(NOT ${_CURRENT_VAR}) ENDFOREACH(_CURRENT_VAR) IF (${_NAME_UPPER}_FOUND) - IF (NOT ${_NAME}_FIND_QUIETLY) - MESSAGE(STATUS "Found ${_NAME}: ${${_VAR1}}") - ENDIF (NOT ${_NAME}_FIND_QUIETLY) + FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_VAR1}}" "${DETAILS}") ELSE (${_NAME_UPPER}_FOUND) IF (${_NAME}_FIND_REQUIRED) MESSAGE(FATAL_ERROR "${_FAIL_MESSAGE}") |