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.
Prior to the existence of the if(DEFINED) condition, many of our Check
modules implemented the condition with a hack that takes advantage of
the auto-dereference behavior of the if() command to detect if a
variable is defined. The hack has the form:
if("${VAR} MATCHES "^${VAR}$")
where "${VAR}" is a macro argument reference. However, this does not
work when the variable named in the macro argument contains characters
that have special meaning in regular expressions, such as '+'. Run the
command
git grep -E 'if\("\$\{.*\}" MATCHES "\^\$\{.*\}\$"\)' -- Modules/Check*
to identify lines with this problem. Use if(NOT DEFINED) instead.
Since commit 7d47c693 (Drop compatibility with CMake < 2.4, 2013-10-08)
we no longer need to use the configure_file IMMEDIATE option to support
compatibility modes less than 2.0.
Ancient versions of CMake required else(), endif(), and similar block
termination commands to have arguments matching the command starting the
block. This is no longer the preferred style.
Run the following shell code:
for c in else endif endforeach endfunction endmacro endwhile; do
echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
egrep -z -v 'Tests/CMakeTests/While-Endwhile-' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
This adds copyright/license notification blocks CMake's non-find
modules. Most of the modules had no notices at all. Some had notices
referring to the BSD license already. This commit normalizes existing
notices and adds missing notices.