summaryrefslogtreecommitdiffstats
path: root/Modules/CheckTypeSize.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/CheckTypeSize.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/CheckTypeSize.cmake')
-rw-r--r--Modules/CheckTypeSize.cmake13
1 files changed, 10 insertions, 3 deletions
diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake
index 333b325..d4651b9 100644
--- a/Modules/CheckTypeSize.cmake
+++ b/Modules/CheckTypeSize.cmake
@@ -59,6 +59,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
# CMAKE_EXTRA_INCLUDE_FILES = list of extra headers to include
#=============================================================================
@@ -85,7 +86,9 @@ get_filename_component(__check_type_size_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
#-----------------------------------------------------------------------------
# Helper function. DO NOT CALL DIRECTLY.
function(__check_type_size_impl type var map builtin language)
- message(STATUS "Check size of ${type}")
+ if(NOT CMAKE_REQUIRED_QUIET)
+ message(STATUS "Check size of ${type}")
+ endif()
# Include header files.
set(headers)
@@ -169,13 +172,17 @@ function(__check_type_size_impl type var map builtin language)
message(SEND_ERROR "CHECK_TYPE_SIZE found different results, consider setting CMAKE_OSX_ARCHITECTURES or CMAKE_TRY_COMPILE_OSX_ARCHITECTURES to one or no architecture !")
endif()
- message(STATUS "Check size of ${type} - done")
+ if(NOT CMAKE_REQUIRED_QUIET)
+ message(STATUS "Check size of ${type} - done")
+ endif()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining size of ${type} passed with the following output:\n${output}\n\n")
set(${var} "${${var}}" CACHE INTERNAL "CHECK_TYPE_SIZE: sizeof(${type})")
else()
# The check failed to compile.
- message(STATUS "Check size of ${type} - failed")
+ if(NOT CMAKE_REQUIRED_QUIET)
+ message(STATUS "Check size of ${type} - failed")
+ endif()
file(READ ${src} content)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining size of ${type} failed with the following output:\n${output}\n${src}:\n${content}\n\n")