From 3b5ea54a27bc69cf64c87dd5dc2bdc227dc4e776 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 16 Sep 2014 09:04:20 -0400 Subject: CheckPrototypeDefinition: Avoid if() auto-dereference Convert from the old if(MATCHES) hack to if(DEFINED) to check whether the result variable is already set. --- Modules/CheckPrototypeDefinition.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/CheckPrototypeDefinition.cmake b/Modules/CheckPrototypeDefinition.cmake index dfa54d8..e203d4c 100644 --- a/Modules/CheckPrototypeDefinition.cmake +++ b/Modules/CheckPrototypeDefinition.cmake @@ -57,7 +57,7 @@ get_filename_component(__check_proto_def_dir "${CMAKE_CURRENT_LIST_FILE}" PATH) function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIABLE) - if ("${_VARIABLE}" MATCHES "^${_VARIABLE}$") + if (NOT DEFINED ${_VARIABLE}) set(CHECK_PROTOTYPE_DEFINITION_CONTENT "/* */\n") set(CHECK_PROTOTYPE_DEFINITION_FLAGS ${CMAKE_REQUIRED_FLAGS}) -- cgit v0.12