cmake_policy(PUSH) cmake_policy(SET CMP0053 OLD) set(FOO "${OLD_WARN_FROM_NORMAL_CMAKE_FILE_INSIDE_BRACES}") set(FOO "@OLD_WARN_FROM_NORMAL_CMAKE_FILE_IN_ATS@") string(CONFIGURE "\${OLD_WARN_FROM_STRING_CONFIGURE_INSIDE_BRACES}" OUT1) file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/file1.in "\@OLD_WARN_FROM_CONFIGURE_FILE_INSIDE_AT\@") configure_file(${CMAKE_CURRENT_BINARY_DIR}/file1.in file1.out) string(CONFIGURE "\@OLD_WARN_FROM_STRING_CONFIGURE_INSIDE_AT\@" OUT2) cmake_policy(POP) cmake_policy(PUSH) cmake_policy(SET CMP0053 NEW) set(FOO "${NEW_WARN_FROM_NORMAL_CMAKE_FILE_INSIDE_BRACES}") string(CONFIGURE "\${NEW_WARN_FROM_STRING_CONFIGURE_INSIDE_BRACES}" OUT3) file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/file2.in "\@NEW_WARN_FROM_CONFIGURE_FILE_INSIDE_AT\@") configure_file(${CMAKE_CURRENT_BINARY_DIR}/file2.in file2.out) string(CONFIGURE "@NEW_WARN_FROM_STRING_CONFIGURE_INSIDE_AT@" OUT4) cmake_policy(POP)