[Cmake-commits] [cmake-commits] hoffman committed CheckTypeSize.cmake 1.30 1.31

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Apr 25 09:09:08 EDT 2008


Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv7498

Modified Files:
	CheckTypeSize.cmake 
Log Message:
ENH: make sure all required headers are checked before checking type size


Index: CheckTypeSize.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CheckTypeSize.cmake,v
retrieving revision 1.30
retrieving revision 1.31
diff -C 2 -d -r1.30 -r1.31
*** CheckTypeSize.cmake	10 Aug 2007 17:14:00 -0000	1.30
--- CheckTypeSize.cmake	25 Apr 2008 13:09:06 -0000	1.31
***************
*** 2,6 ****
  #  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.
  #  VARIABLE - variable to store size if the type exists.
  #  HAVE_${VARIABLE} - does the variable exists or not
--- 2,10 ----
  #  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. 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
***************
*** 13,16 ****
--- 17,28 ----
  #  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}$")



More information about the Cmake-commits mailing list