diff options
author | Kitware Robot <kwrobot@kitware.com> | 2019-05-10 19:34:33 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-05-14 19:26:46 (GMT) |
commit | 932dcce1e63b98739ab547f2146a39310c2d0e1e (patch) | |
tree | 6802b7f96be03d8bfee2867c0f308307982d6ffc /Modules/CheckStructHasMember.cmake | |
parent | e2d0aea2c734c8c5028f3573082e75bd157dbe72 (diff) | |
download | CMake-932dcce1e63b98739ab547f2146a39310c2d0e1e.zip CMake-932dcce1e63b98739ab547f2146a39310c2d0e1e.tar.gz CMake-932dcce1e63b98739ab547f2146a39310c2d0e1e.tar.bz2 |
Modules: Consistently use 2 space indentation
Diffstat (limited to 'Modules/CheckStructHasMember.cmake')
-rw-r--r-- | Modules/CheckStructHasMember.cmake | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/Modules/CheckStructHasMember.cmake b/Modules/CheckStructHasMember.cmake index 7fef857..842a8fd 100644 --- a/Modules/CheckStructHasMember.cmake +++ b/Modules/CheckStructHasMember.cmake @@ -50,33 +50,33 @@ include(CheckCSourceCompiles) include(CheckCXXSourceCompiles) macro (CHECK_STRUCT_HAS_MEMBER _STRUCT _MEMBER _HEADER _RESULT) - set(_INCLUDE_FILES) - foreach (it ${_HEADER}) - string(APPEND _INCLUDE_FILES "#include <${it}>\n") - endforeach () - - if("x${ARGN}" STREQUAL "x") - set(_lang C) - elseif("x${ARGN}" MATCHES "^xLANGUAGE;([a-zA-Z]+)$") - set(_lang "${CMAKE_MATCH_1}") - else() - message(FATAL_ERROR "Unknown arguments:\n ${ARGN}\n") - endif() - - set(_CHECK_STRUCT_MEMBER_SOURCE_CODE " + set(_INCLUDE_FILES) + foreach (it ${_HEADER}) + string(APPEND _INCLUDE_FILES "#include <${it}>\n") + endforeach () + + if("x${ARGN}" STREQUAL "x") + set(_lang C) + elseif("x${ARGN}" MATCHES "^xLANGUAGE;([a-zA-Z]+)$") + set(_lang "${CMAKE_MATCH_1}") + else() + message(FATAL_ERROR "Unknown arguments:\n ${ARGN}\n") + endif() + + set(_CHECK_STRUCT_MEMBER_SOURCE_CODE " ${_INCLUDE_FILES} int main() { - (void)sizeof(((${_STRUCT} *)0)->${_MEMBER}); - return 0; + (void)sizeof(((${_STRUCT} *)0)->${_MEMBER}); + return 0; } ") - if("${_lang}" STREQUAL "C") - CHECK_C_SOURCE_COMPILES("${_CHECK_STRUCT_MEMBER_SOURCE_CODE}" ${_RESULT}) - elseif("${_lang}" STREQUAL "CXX") - CHECK_CXX_SOURCE_COMPILES("${_CHECK_STRUCT_MEMBER_SOURCE_CODE}" ${_RESULT}) - else() - message(FATAL_ERROR "Unknown language:\n ${_lang}\nSupported languages: C, CXX.\n") - endif() + if("${_lang}" STREQUAL "C") + CHECK_C_SOURCE_COMPILES("${_CHECK_STRUCT_MEMBER_SOURCE_CODE}" ${_RESULT}) + elseif("${_lang}" STREQUAL "CXX") + CHECK_CXX_SOURCE_COMPILES("${_CHECK_STRUCT_MEMBER_SOURCE_CODE}" ${_RESULT}) + else() + message(FATAL_ERROR "Unknown language:\n ${_lang}\nSupported languages: C, CXX.\n") + endif() endmacro () |