summaryrefslogtreecommitdiff
path: root/Modules/CheckTypeSize.cmake
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2013-02-13 18:21:12 -0800
committerAnas Nashif <anas.nashif@intel.com>2013-02-13 18:21:12 -0800
commitef8aa19c33e83ff019595fd7f8fdc29c35c336a3 (patch)
tree6501b44707b5c6a88fa5f817adee1a3ffcb0012d /Modules/CheckTypeSize.cmake
parent035c7fabc3b82cbc9a346c11abe2e9462b4c0379 (diff)
downloadcmake-ef8aa19c33e83ff019595fd7f8fdc29c35c336a3.tar.gz
cmake-ef8aa19c33e83ff019595fd7f8fdc29c35c336a3.tar.bz2
cmake-ef8aa19c33e83ff019595fd7f8fdc29c35c336a3.zip
Imported Upstream version 2.8.10.2upstream/2.8.10.2
Diffstat (limited to 'Modules/CheckTypeSize.cmake')
-rw-r--r--Modules/CheckTypeSize.cmake9
1 files changed, 7 insertions, 2 deletions
diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake
index 1717718c9..7285b8a6d 100644
--- a/Modules/CheckTypeSize.cmake
+++ b/Modules/CheckTypeSize.cmake
@@ -24,6 +24,11 @@
# size check automatically includes the available headers, thus
# supporting checks of types defined in the headers.
#
+# Despite the name of the macro you may use it to check the size of
+# more complex expressions, too. To check e.g. for the size of a struct
+# member you can do something like this:
+# check_type_size("((struct something*)0)->member" SIZEOF_MEMBER)
+#
# The following variables may be set before calling this macro to
# modify the way the check is run:
#
@@ -142,7 +147,7 @@ function(__check_type_size_impl type var map builtin)
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(HAVE_${var})
+ else()
# The check failed to compile.
message(STATUS "Check size of ${type} - failed")
file(READ ${src} content)
@@ -150,7 +155,7 @@ function(__check_type_size_impl type var map builtin)
"Determining size of ${type} failed with the following output:\n${output}\n${src}:\n${content}\n\n")
set(${var} "" CACHE INTERNAL "CHECK_TYPE_SIZE: ${type} unknown")
file(REMOVE ${map})
- endif(HAVE_${var})
+ endif()
endfunction()
#-----------------------------------------------------------------------------