diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake index 73ad86ebb..8c7acb5d8 100644 --- a/Modules/CheckTypeSize.cmake +++ b/Modules/CheckTypeSize.cmake @@ -83,6 +83,7 @@ include(CheckIncludeFileCXX) cmake_policy(PUSH) cmake_policy(VERSION 3.0) +cmake_policy(SET CMP0054 NEW) get_filename_component(__check_type_size_dir "${CMAKE_CURRENT_LIST_FILE}" PATH) @@ -112,9 +113,9 @@ function(__check_type_size_impl type var map builtin language) # Perform the check. - if("${language}" STREQUAL "C") + if(language STREQUAL "C") set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.c) - elseif("${language}" STREQUAL "CXX") + elseif(language STREQUAL "CXX") set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.cpp) else() message(FATAL_ERROR "Unknown language:\n ${language}\nSupported languages: C, CXX.\n") @@ -229,11 +230,11 @@ macro(CHECK_TYPE_SIZE TYPE VARIABLE) set(_builtin 0) else() set(_builtin 1) - if("${_language}" STREQUAL "C") + if(_language STREQUAL "C") 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) - elseif("${_language}" STREQUAL "CXX") + elseif(_language STREQUAL "CXX") check_include_file_cxx(sys/types.h HAVE_SYS_TYPES_H) check_include_file_cxx(stdint.h HAVE_STDINT_H) check_include_file_cxx(stddef.h HAVE_STDDEF_H)