From 43b69b2aed6f2b282643dad6056c5652c12da090 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Wed, 26 Oct 2016 18:04:07 +0300 Subject: [PATCH] cmake: fix CheckFunctionExistsEx/CheckPrototypeDefinition (CMP0054) --- cmake/CheckFunctionExistsEx.cmake | 4 ++-- cmake/CheckPrototypeDefinition.cmake | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/cmake/CheckFunctionExistsEx.cmake b/cmake/CheckFunctionExistsEx.cmake index f513f4e1..78bc2ecc 100644 --- a/cmake/CheckFunctionExistsEx.cmake +++ b/cmake/CheckFunctionExistsEx.cmake @@ -28,7 +28,7 @@ # License text for the above reference.) MACRO(CHECK_FUNCTION_EXISTS_EX FUNCTION VARIABLE) - IF("${VARIABLE}" MATCHES "^${VARIABLE}$") + IF(${VARIABLE} MATCHES "^${VARIABLE}$") SET(MACRO_CHECK_FUNCTION_DEFINITIONS "-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}") MESSAGE(STATUS "Looking for ${FUNCTION}") @@ -65,5 +65,5 @@ MACRO(CHECK_FUNCTION_EXISTS_EX FUNCTION VARIABLE) "Determining if the function ${FUNCTION} exists failed with the following output:\n" "${OUTPUT}\n\n") ENDIF(${VARIABLE}) - ENDIF("${VARIABLE}" MATCHES "^${VARIABLE}$") + ENDIF() ENDMACRO(CHECK_FUNCTION_EXISTS_EX) diff --git a/cmake/CheckPrototypeDefinition.cmake b/cmake/CheckPrototypeDefinition.cmake index e0c6a572..940d1ff0 100644 --- a/cmake/CheckPrototypeDefinition.cmake +++ b/cmake/CheckPrototypeDefinition.cmake @@ -25,8 +25,7 @@ function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIABLE) - - if ("${_VARIABLE}" MATCHES "^${_VARIABLE}$") + if (${_VARIABLE} MATCHES "^${_VARIABLE}$") set(CHECK_PROTOTYPE_DEFINITION_CONTENT "/* */\n") set(CHECK_PROTOTYPE_DEFINITION_FLAGS ${CMAKE_REQUIRED_FLAGS}) @@ -79,6 +78,5 @@ function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIAB "Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} failed with the following output:\n" "${OUTPUT}\n\n${_SOURCE}\n\n") endif (${_VARIABLE}) - endif("${_VARIABLE}" MATCHES "^${_VARIABLE}$") - + endif() endfunction(CHECK_PROTOTYPE_DEFINITION)