diff options
author | Clinton Stimpson <clinton@elemtech.com> | 2014-03-29 20:12:27 -0600 |
---|---|---|
committer | Clinton Stimpson <clinton@elemtech.com> | 2014-03-29 20:14:23 -0600 |
commit | 4c0cc9ab9195d348ea5f1b004789ec334531bbb1 (patch) | |
tree | 8265de61b683bf0f6fa89dae3026f4b4b5159388 /Modules/CheckLibraryExists.cmake | |
parent | ede0419a376cd3ddc26058f910318c76e0077bb1 (diff) | |
download | cmake-4c0cc9ab9195d348ea5f1b004789ec334531bbb1.tar.gz |
Check*.cmake : Add CMAKE_REQUIRED_QUIET flag.
Setting this flag can silence messages from the Check*.cmake modules.
This can be used by Find*.cmake modules when they are in silent mode.
Diffstat (limited to 'Modules/CheckLibraryExists.cmake')
-rw-r--r-- | Modules/CheckLibraryExists.cmake | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Modules/CheckLibraryExists.cmake b/Modules/CheckLibraryExists.cmake index f5c563c208..2b4137956e 100644 --- a/Modules/CheckLibraryExists.cmake +++ b/Modules/CheckLibraryExists.cmake @@ -23,6 +23,7 @@ # CMAKE_REQUIRED_FLAGS = string of compile command line flags # CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) # CMAKE_REQUIRED_LIBRARIES = list of libraries to link +# CMAKE_REQUIRED_QUIET = execute quietly without messages #============================================================================= # Copyright 2002-2009 Kitware, Inc. @@ -43,7 +44,9 @@ macro(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE) if("${VARIABLE}" MATCHES "^${VARIABLE}$") set(MACRO_CHECK_LIBRARY_EXISTS_DEFINITION "-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}") - message(STATUS "Looking for ${FUNCTION} in ${LIBRARY}") + if(NOT CMAKE_REQUIRED_QUIET) + message(STATUS "Looking for ${FUNCTION} in ${LIBRARY}") + endif() set(CHECK_LIBRARY_EXISTS_LIBRARIES ${LIBRARY}) if(CMAKE_REQUIRED_LIBRARIES) set(CHECK_LIBRARY_EXISTS_LIBRARIES @@ -60,14 +63,18 @@ macro(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE) OUTPUT_VARIABLE OUTPUT) if(${VARIABLE}) - message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - found") + if(NOT CMAKE_REQUIRED_QUIET) + message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - found") + endif() set(${VARIABLE} 1 CACHE INTERNAL "Have library ${LIBRARY}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the function ${FUNCTION} exists in the ${LIBRARY} " "passed with the following output:\n" "${OUTPUT}\n\n") else() - message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - not found") + if(NOT CMAKE_REQUIRED_QUIET) + message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - not found") + endif() set(${VARIABLE} "" CACHE INTERNAL "Have library ${LIBRARY}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the function ${FUNCTION} exists in the ${LIBRARY} " |