summaryrefslogtreecommitdiffstats
path: root/Modules/CheckCXXSourceRuns.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/CheckCXXSourceRuns.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/CheckCXXSourceRuns.cmake')
-rw-r--r--Modules/CheckCXXSourceRuns.cmake13
1 files changed, 10 insertions, 3 deletions
diff --git a/Modules/CheckCXXSourceRuns.cmake b/Modules/CheckCXXSourceRuns.cmake
index 4e3ff6c..c655863 100644
--- a/Modules/CheckCXXSourceRuns.cmake
+++ b/Modules/CheckCXXSourceRuns.cmake
@@ -21,6 +21,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 2006-2009 Kitware, Inc.
@@ -56,7 +57,9 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx"
"${SOURCE}\n")
- message(STATUS "Performing Test ${VAR}")
+ if(NOT CMAKE_REQUIRED_QUIET)
+ message(STATUS "Performing Test ${VAR}")
+ endif()
try_run(${VAR}_EXITCODE ${VAR}_COMPILED
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx
@@ -74,7 +77,9 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
# if the return value was 0 then it worked
if("${${VAR}_EXITCODE}" EQUAL 0)
set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
- message(STATUS "Performing Test ${VAR} - Success")
+ if(NOT CMAKE_REQUIRED_QUIET)
+ message(STATUS "Performing Test ${VAR} - Success")
+ endif()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n"
"${OUTPUT}\n"
@@ -87,7 +92,9 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
endif()
- message(STATUS "Performing Test ${VAR} - Failed")
+ if(NOT CMAKE_REQUIRED_QUIET)
+ message(STATUS "Performing Test ${VAR} - Failed")
+ endif()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n"
"${OUTPUT}\n"