cmake: fix CheckFunctionExistsEx/CheckPrototypeDefinition (CMP0054)

This commit is contained in:
Azat Khuzhin 2016-10-26 18:04:07 +03:00
parent dc624adf42
commit 43b69b2aed
2 changed files with 4 additions and 6 deletions

View File

@ -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)

View File

@ -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)