From 6784f0a6eb21a3b6a0969aa08482ba7e3b23fa20 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Sat, 16 May 2015 22:40:46 +0200 Subject: CheckTypeSize: Avoid if() auto-dereferene in quoted arguments (#15571) Exposed by a CMP0054 warning. Set CMP0054 to NEW since no code in this module depends on the old behavior. --- Modules/CheckTypeSize.cmake | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake index 73ad86e..8c7acb5 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) -- cgit v0.12