Merge topic 'cleanup-CMP0054'
fa7d47ac
Tests: Fix CMP0054 warnings3b5ea54a
CheckPrototypeDefinition: Avoid if() auto-dereferencec9b301cd
ExternalProject: Fix CMP0054 warning in _ep_parse_arguments
This commit is contained in:
commit
f28ebcbf1b
|
@ -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})
|
||||
|
|
|
@ -240,7 +240,7 @@ function(_ep_parse_arguments f name ns args)
|
|||
set(is_value 1)
|
||||
|
||||
if(arg MATCHES "^[A-Z][A-Z0-9_][A-Z0-9_]+$" AND
|
||||
NOT ((arg STREQUAL "${key}") AND (key STREQUAL "COMMAND")) AND
|
||||
NOT (("x${arg}x" STREQUAL "x${key}x") AND ("x${key}x" STREQUAL "xCOMMANDx")) AND
|
||||
NOT arg MATCHES "^(TRUE|FALSE)$")
|
||||
if(_ep_keywords_${f} AND arg MATCHES "${_ep_keywords_${f}}")
|
||||
set(is_value 0)
|
||||
|
|
|
@ -20,13 +20,13 @@ endif ()
|
|||
|
||||
string(TOUPPER "${MAJOR_TEST_MODULE}" MODULE_UPPER)
|
||||
|
||||
if ( ( ${MAJOR_TEST_MODULE}_FOUND OR ${MODULE_UPPER}_FOUND ) AND "${VERSION_VAR}")
|
||||
if ( ( ${MAJOR_TEST_MODULE}_FOUND OR ${MODULE_UPPER}_FOUND ) AND ${VERSION_VAR})
|
||||
message(STATUS "${VERSION_VAR} is '${${VERSION_VAR}}'")
|
||||
if ("${VERSION_VAR}" VERSION_LESS MAJOR_TEST_VERSION)
|
||||
if (${VERSION_VAR} VERSION_LESS MAJOR_TEST_VERSION)
|
||||
message(SEND_ERROR "Found version ${${VERSION_VAR}} is less than requested major version ${MAJOR_TEST_VERSION}")
|
||||
endif ()
|
||||
math(EXPR V_PLUS_ONE "${MAJOR_TEST_VERSION} + 1")
|
||||
if ("${VERSION_VAR}" VERSION_GREATER V_PLUS_ONE)
|
||||
if (${VERSION_VAR} VERSION_GREATER V_PLUS_ONE)
|
||||
message(SEND_ERROR "Found version ${${VERSION_VAR}} is greater than requested major version ${MAJOR_TEST_VERSION}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
|
|
@ -92,7 +92,7 @@ endfunction()
|
|||
|
||||
STRANGE_FUNCTION(var)
|
||||
set(second_var "second_var")
|
||||
if("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var")
|
||||
if("x${var}" STREQUAL "xstrange_function" AND "x${second_var}" STREQUAL "xsecond_var")
|
||||
PASS("Case Test" "(${var} ${second_var})")
|
||||
else()
|
||||
FAILED("Case test" "(${var} ${second_var})")
|
||||
|
|
|
@ -36,7 +36,7 @@ macro(strange_macro m)
|
|||
endmacro()
|
||||
STRANGE_MACRO(var)
|
||||
set(second_var "second_var")
|
||||
if("${var}" STREQUAL "strange_macro" AND "${second_var}" STREQUAL "second_var")
|
||||
if("x${var}" STREQUAL "xstrange_macro" AND "x${second_var}" STREQUAL "xsecond_var")
|
||||
PASS("Case Test" "(${var} ${second_var})")
|
||||
else()
|
||||
FAILED("Case test" "(${var} ${second_var})")
|
||||
|
|
|
@ -26,7 +26,7 @@ endif()
|
|||
|
||||
pkg_check_modules(FOO "${expected_path}")
|
||||
|
||||
if(NOT "FOO_FOUND")
|
||||
if(NOT FOO_FOUND)
|
||||
message(FATAL_ERROR "Expected PKG_CONFIG_PATH: \"${expected_path}\".")
|
||||
endif()
|
||||
|
||||
|
@ -36,6 +36,6 @@ set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
|
|||
|
||||
pkg_check_modules(BAR "${expected_path}" NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH)
|
||||
|
||||
if(NOT "BAR_FOUND")
|
||||
if(NOT BAR_FOUND)
|
||||
message(FATAL_ERROR "Expected PKG_CONFIG_PATH: \"${expected_path}\".")
|
||||
endif()
|
||||
|
|
|
@ -46,6 +46,6 @@ endif()
|
|||
|
||||
pkg_check_modules(FOO "${expected_path}")
|
||||
|
||||
if(NOT "FOO_FOUND")
|
||||
if(NOT FOO_FOUND)
|
||||
message(FATAL_ERROR "Expected PKG_CONFIG_PATH: \"${expected_path}\".")
|
||||
endif()
|
||||
|
|
|
@ -46,6 +46,6 @@ endif()
|
|||
|
||||
pkg_check_modules(FOO "${expected_path}" NO_CMAKE_ENVIRONMENT_PATH)
|
||||
|
||||
if(NOT "FOO_FOUND")
|
||||
if(NOT FOO_FOUND)
|
||||
message(FATAL_ERROR "Expected PKG_CONFIG_PATH: \"${expected_path}\".")
|
||||
endif()
|
||||
|
|
|
@ -46,6 +46,6 @@ endif()
|
|||
|
||||
pkg_check_modules(FOO "${expected_path}" NO_CMAKE_PATH)
|
||||
|
||||
if(NOT "FOO_FOUND")
|
||||
if(NOT FOO_FOUND)
|
||||
message(FATAL_ERROR "Expected PKG_CONFIG_PATH: \"${expected_path}\".")
|
||||
endif()
|
||||
|
|
|
@ -123,7 +123,7 @@ string(STRIP "ST2 " ST2)
|
|||
string(STRIP " ST3" ST3)
|
||||
|
||||
foreach(var ST1 ST2 ST3)
|
||||
if("${var}" STREQUAL "${${var}}")
|
||||
if("x${var}" STREQUAL "x${${var}}")
|
||||
message("[${var}] == [${${var}}]")
|
||||
else()
|
||||
message(SEND_ERROR "Problem with the STRIP command for ${var}: [${${var}}]")
|
||||
|
|
Loading…
Reference in New Issue