summaryrefslogtreecommitdiffstats
path: root/Modules/CheckFunctionExists.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/CheckFunctionExists.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/CheckFunctionExists.cmake')
-rw-r--r--Modules/CheckFunctionExists.cmake13
1 files changed, 10 insertions, 3 deletions
diff --git a/Modules/CheckFunctionExists.cmake b/Modules/CheckFunctionExists.cmake
index e232bd7..bfd1836 100644
--- a/Modules/CheckFunctionExists.cmake
+++ b/Modules/CheckFunctionExists.cmake
@@ -20,6 +20,7 @@
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
# CMAKE_REQUIRED_INCLUDES = list of include directories
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
+# CMAKE_REQUIRED_QUIET = execute quietly without messages
#=============================================================================
# Copyright 2002-2011 Kitware, Inc.
@@ -40,7 +41,9 @@ macro(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
if("${VARIABLE}" MATCHES "^${VARIABLE}$")
set(MACRO_CHECK_FUNCTION_DEFINITIONS
"-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}")
- message(STATUS "Looking for ${FUNCTION}")
+ if(NOT CMAKE_REQUIRED_QUIET)
+ message(STATUS "Looking for ${FUNCTION}")
+ endif()
if(CMAKE_REQUIRED_LIBRARIES)
set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
@@ -63,12 +66,16 @@ macro(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
OUTPUT_VARIABLE OUTPUT)
if(${VARIABLE})
set(${VARIABLE} 1 CACHE INTERNAL "Have function ${FUNCTION}")
- message(STATUS "Looking for ${FUNCTION} - found")
+ if(NOT CMAKE_REQUIRED_QUIET)
+ message(STATUS "Looking for ${FUNCTION} - found")
+ endif()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the function ${FUNCTION} exists passed with the following output:\n"
"${OUTPUT}\n\n")
else()
- message(STATUS "Looking for ${FUNCTION} - not found")
+ if(NOT CMAKE_REQUIRED_QUIET)
+ message(STATUS "Looking for ${FUNCTION} - not found")
+ endif()
set(${VARIABLE} "" CACHE INTERNAL "Have function ${FUNCTION}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the function ${FUNCTION} exists failed with the following output:\n"