diff options
author | Clinton Stimpson <clinton@elemtech.com> | 2014-03-30 02:12:27 (GMT) |
---|---|---|
committer | Clinton Stimpson <clinton@elemtech.com> | 2014-03-30 02:14:23 (GMT) |
commit | 4c0cc9ab9195d348ea5f1b004789ec334531bbb1 (patch) | |
tree | 8265de61b683bf0f6fa89dae3026f4b4b5159388 /Modules/CheckVariableExists.cmake | |
parent | ede0419a376cd3ddc26058f910318c76e0077bb1 (diff) | |
download | CMake-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/CheckVariableExists.cmake')
-rw-r--r-- | Modules/CheckVariableExists.cmake | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Modules/CheckVariableExists.cmake b/Modules/CheckVariableExists.cmake index 4861ff0..3a7ef13 100644 --- a/Modules/CheckVariableExists.cmake +++ b/Modules/CheckVariableExists.cmake @@ -27,6 +27,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. @@ -47,7 +48,9 @@ macro(CHECK_VARIABLE_EXISTS VAR VARIABLE) if("${VARIABLE}" MATCHES "^${VARIABLE}$") set(MACRO_CHECK_VARIABLE_DEFINITIONS "-DCHECK_VARIABLE_EXISTS=${VAR} ${CMAKE_REQUIRED_FLAGS}") - message(STATUS "Looking for ${VAR}") + if(NOT CMAKE_REQUIRED_QUIET) + message(STATUS "Looking for ${VAR}") + endif() if(CMAKE_REQUIRED_LIBRARIES) set(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) @@ -63,13 +66,17 @@ macro(CHECK_VARIABLE_EXISTS VAR VARIABLE) OUTPUT_VARIABLE OUTPUT) if(${VARIABLE}) set(${VARIABLE} 1 CACHE INTERNAL "Have variable ${VAR}") - message(STATUS "Looking for ${VAR} - found") + if(NOT CMAKE_REQUIRED_QUIET) + message(STATUS "Looking for ${VAR} - found") + endif() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the variable ${VAR} exists passed with the following output:\n" "${OUTPUT}\n\n") else() set(${VARIABLE} "" CACHE INTERNAL "Have variable ${VAR}") - message(STATUS "Looking for ${VAR} - not found") + if(NOT CMAKE_REQUIRED_QUIET) + message(STATUS "Looking for ${VAR} - not found") + endif() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the variable ${VAR} exists failed with the following output:\n" "${OUTPUT}\n\n") |