ENH: fix checktypesize

This commit is contained in:
Bill Hoffman 2006-01-13 09:57:15 -05:00
parent 0c644dea70
commit 96f948adf5
2 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,7 @@
@CHECK_TYPE_SIZE_PREINCLUDE@
#cmakedefine CHECK_TYPE_SIZE_TYPE @CHECK_TYPE_SIZE_TYPE@
#ifdef CHECK_TYPE_SIZE_TYPE
@CHECK_TYPE_SIZE_PREINCLUDE@
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif /* HAVE_SYS_TYPES_H */

View File

@ -9,6 +9,7 @@
MACRO(CHECK_TYPE_SIZE TYPE VARIABLE)
SET(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1)
IF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
SET(CHECK_TYPE_SIZE_TYPE "${TYPE}")
SET(MACRO_CHECK_TYPE_SIZE_FLAGS
"${CMAKE_REQUIRED_FLAGS}")
FOREACH(def HAVE_SYS_TYPES_H HAVE_STDINT_H HAVE_STDDEF_H)
@ -17,7 +18,7 @@ MACRO(CHECK_TYPE_SIZE TYPE VARIABLE)
"${MACRO_CHECK_TYPE_SIZE_FLAGS} -D${def}")
ENDIF("${def}")
ENDFOREACH(def)
SET(CHECK_TYPE_SIZE_PREINCLUDE "#define CHECK_TYPE_SIZE_TYPE ${TYPE}\n")
SET(CHECK_TYPE_SIZE_PREINCLUDE)
FOREACH(def ${CMAKE_EXTRA_INCLUDE_FILES})
SET(CHECK_TYPE_SIZE_PREMAIN "${CHECK_TYPE_SIZE_PREMAIN}#include \"${def}\"\n")
ENDFOREACH(def)