summaryrefslogtreecommitdiffstats
path: root/Modules/CheckLibraryExists.cmake
diff options
context:
space:
mode:
authorClinton Stimpson <clinton@elemtech.com>2014-03-30 02:12:27 (GMT)
committerClinton Stimpson <clinton@elemtech.com>2014-03-30 02:14:23 (GMT)
commit4c0cc9ab9195d348ea5f1b004789ec334531bbb1 (patch)
tree8265de61b683bf0f6fa89dae3026f4b4b5159388 /Modules/CheckLibraryExists.cmake
parentede0419a376cd3ddc26058f910318c76e0077bb1 (diff)
downloadCMake-4c0cc9ab9195d348ea5f1b004789ec334531bbb1.zip
CMake-4c0cc9ab9195d348ea5f1b004789ec334531bbb1.tar.gz
CMake-4c0cc9ab9195d348ea5f1b004789ec334531bbb1.tar.bz2
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.cmake13
1 files changed, 10 insertions, 3 deletions
diff --git a/Modules/CheckLibraryExists.cmake b/Modules/CheckLibraryExists.cmake
index f5c563c..2b41379 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} "