diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2008-04-25 13:09:06 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2008-04-25 13:09:06 (GMT) |
commit | 5f689656087b682afede0ef9a377b5bbe2abf4ea (patch) | |
tree | 289d59712fe69844aca569d70d9e521c5783d5d0 /Modules | |
parent | 6482d38bdf53ff5f3d12bb596b6dee4d08618b45 (diff) | |
download | CMake-5f689656087b682afede0ef9a377b5bbe2abf4ea.zip CMake-5f689656087b682afede0ef9a377b5bbe2abf4ea.tar.gz CMake-5f689656087b682afede0ef9a377b5bbe2abf4ea.tar.bz2 |
ENH: make sure all required headers are checked before checking type size
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CheckTypeSize.cmake | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake index 0e7e364..37ea75d 100644 --- a/Modules/CheckTypeSize.cmake +++ b/Modules/CheckTypeSize.cmake @@ -1,7 +1,11 @@ # - Check sizeof a type # CHECK_TYPE_SIZE(TYPE VARIABLE) # Check if the type exists and determine size of type. if the type -# exists, the size will be stored to the variable. +# exists, the size will be stored to the variable. This also +# calls check_include_file for sys/types.h stdint.h +# and stddef.h, setting HAVE_SYS_TYPES_H, HAVE_STDINT_H, +# and HAVE_STDDEF_H. This is because many types are stored +# in these include files. # VARIABLE - variable to store size if the type exists. # HAVE_${VARIABLE} - does the variable exists or not # The following variables may be set before calling this macro to @@ -12,6 +16,14 @@ # CMAKE_REQUIRED_INCLUDES = list of include directories # CMAKE_REQUIRED_LIBRARIES = list of libraries to link +# These variables are referenced in CheckTypeSizeC.c so we have +# 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("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") MESSAGE(STATUS "Check size of ${TYPE}") |