summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2008-04-25 14:47:34 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2008-04-25 14:47:34 (GMT)
commit779a2abda354dc8b667ab0ad1c4d983d867f01e0 (patch)
tree8d4b16d96d4713f705661e31ad44caa14af851ba /Modules
parent7c6c8fc36510a93a12e5c381646678f43810ce13 (diff)
downloadCMake-779a2abda354dc8b667ab0ad1c4d983d867f01e0.zip
CMake-779a2abda354dc8b667ab0ad1c4d983d867f01e0.tar.gz
CMake-779a2abda354dc8b667ab0ad1c4d983d867f01e0.tar.bz2
ENH: allow users to turn off extra checks
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CheckTypeSize.cmake14
1 files changed, 10 insertions, 4 deletions
diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake
index 37ea75d..cc5dceb 100644
--- a/Modules/CheckTypeSize.cmake
+++ b/Modules/CheckTypeSize.cmake
@@ -1,5 +1,5 @@
# - Check sizeof a type
-# CHECK_TYPE_SIZE(TYPE VARIABLE)
+# CHECK_TYPE_SIZE(TYPE VARIABLE [BUILTIN_TYPES_ONLY])
# Check if the type exists and determine size of type. if the type
# exists, the size will be stored to the variable. This also
# calls check_include_file for sys/types.h stdint.h
@@ -8,6 +8,9 @@
# in these include files.
# VARIABLE - variable to store size if the type exists.
# HAVE_${VARIABLE} - does the variable exists or not
+# BUILTIN_TYPES_ONLY - The third argument is optional and if
+# it is set to the string BUILTIN_TYPES_ONLY
+# this macro will not check for any header files.
# The following variables may be set before calling this macro to
# modify the way the check is run:
#
@@ -20,11 +23,14 @@
# to check for them.
include(CheckIncludeFile)
-check_include_file(sys/types.h HAVE_SYS_TYPES_H)
-check_include_file(stdint.h HAVE_STDINT_H)
-check_include_file(stddef.h HAVE_STDDEF_H)
MACRO(CHECK_TYPE_SIZE TYPE VARIABLE)
+ IF(NOT "${ARGV2}" STREQUAL "BUILTIN_TYPES_ONLY")
+ check_include_file(sys/types.h HAVE_SYS_TYPES_H)
+ check_include_file(stdint.h HAVE_STDINT_H)
+ check_include_file(stddef.h HAVE_STDDEF_H)
+ ENDIF(NOT "${ARGV2}" STREQUAL "BUILTIN_TYPES_ONLY")
+
IF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
MESSAGE(STATUS "Check size of ${TYPE}")
SET(CHECK_TYPE_SIZE_TYPE "${TYPE}")