Commit 4ffec8f6 authored by Brad King's avatar Brad King

Check*: Add compatibility hack for old VXL code

The cleanup in commit 4f2fcce4 (Check*: Allow result variables to
contain regex special characters, 2014-07-31) broke old VXL code that
abuses the old "if(MATCHES)" implementation by using

  SET( ${VARIABLE} ${VARIABLE} )

to reset a check result variable.  Add a compatibility hack to the
CheckFunctionExists, CheckIncludeFileCXX, and CheckSymbolExists modules
to re-run their checks when the result variable is set to its own name.
Use STREQUAL instead of MATCHES so that special characters still work.
parent 4f2fcce4
......@@ -38,7 +38,7 @@
macro(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
if(NOT DEFINED "${VARIABLE}")
if(NOT DEFINED "${VARIABLE}" OR "x${${VARIABLE}}" STREQUAL "x${VARIABLE}")
set(MACRO_CHECK_FUNCTION_DEFINITIONS
"-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}")
if(NOT CMAKE_REQUIRED_QUIET)
......
......@@ -44,7 +44,7 @@
# License text for the above reference.)
macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
if(NOT DEFINED "${VARIABLE}")
if(NOT DEFINED "${VARIABLE}" OR "x${${VARIABLE}}" STREQUAL "x${VARIABLE}")
if(CMAKE_REQUIRED_INCLUDES)
set(CHECK_INCLUDE_FILE_CXX_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}")
else()
......
......@@ -50,7 +50,7 @@ macro(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
endmacro()
macro(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
if(NOT DEFINED "${VARIABLE}")
if(NOT DEFINED "${VARIABLE}" OR "x${${VARIABLE}}" STREQUAL "x${VARIABLE}")
set(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n")
set(MACRO_CHECK_SYMBOL_EXISTS_FLAGS ${CMAKE_REQUIRED_FLAGS})
if(CMAKE_REQUIRED_LIBRARIES)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment