Some Check* modules may be broken by CMAKE_TRY_COMPILE_TARGET_TYPE
Observed with cmake 3.11, looking at cmake repo master branch would expect that it's still a problem.
Setting CMAKE_TRY_COMPILE_TARGET_TYPE to STATIC_LIBRARY will subvert the behaviour of the CHECK_FUNCTION_EXISTS macro, causing it to always return true/success (as it will never attempt the link step that is intended to confirm the function availability). The macro should either override CMAKE_TRY_COMPILE_TARGET_TYPE to EXECUTABLE for it's contained try_compile() call, or at least sanity check the variable and abort with a message(FATAL_ERROR ...) if it is set to STATIC_LIBRARY.
Wouldn't be surprised if this was a problem with some of the other CHECK_XXX macros too.
Came across this as I'd set CMAKE_TRY_COMPILE_TARGET_TYPE = STATIC_LIBRARY in a cross-compiler toolchain file to work around problems with compiler detection (as suggested in cmake documentation), and then at a later date included a 3rd party sub-project that used CHECK_FUNCTION_EXISTS()