cmake: avoid `@var@` expansion in older CMake versions

Older versions of CMake expanded `@var@` in CMake code, so this could be
expanded at this location rather than the `string(CONFIGURE)` call if
`module` were set inadvertently. Instead, hide the literal `@` symbol
from CMake, but not from the string.

This avoids a CMP0053 warning for projects using Qt5 with a minimum
version set lower than 3.1 and silent bugs with projects explicitly
setting CMP0053 to OLD.

Change-Id: I0e4a86469fdf69b8706387799ab9b17498b8d1ca
Reviewed-by: Stephen Kelly <steveire@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
bb10
Ben Boeckel 2017-02-09 12:12:28 -05:00 committed by André Klitzing
parent c3cd0f6e19
commit bb1e5675a5
1 changed files with 3 additions and 1 deletions

View File

@ -1,4 +1,6 @@
set(_qt5_root_dir ${_qt5_install_prefix})
set(_qt5_module_paths ${_qt5_install_prefix})
set(_qt5_module_location_template ${_qt5_install_prefix}/Qt5@module@/Qt5@module@Config.cmake)
set(_qt5_at "@")
set(_qt5_module_location_template ${_qt5_install_prefix}/Qt5${_qt5_at}module${_qt5_at}/Qt5${_qt5_at}module${_qt5_at}Config.cmake)
unset(_qt5_at)