From 0ae78b76d544adad4860b66bdd6279fdde07ea34 Mon Sep 17 00:00:00 2001 From: David Cole Date: Wed, 24 Aug 2011 14:06:51 -0400 Subject: [PATCH] FindPackageMessage: Eliminate new lines in cache entries Fix problem exposed by recent commit to FindPythonInterp. If the find "details" has new lines in it, then replace them with literal "\n" two character sequences so that the string may be saved as a cache entry that can be re-read next time CMake runs. --- Modules/FindPackageMessage.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/FindPackageMessage.cmake b/Modules/FindPackageMessage.cmake index eb398b2ae..5afee3e39 100644 --- a/Modules/FindPackageMessage.cmake +++ b/Modules/FindPackageMessage.cmake @@ -34,6 +34,7 @@ FUNCTION(FIND_PACKAGE_MESSAGE pkg msg details) # Avoid printing a message repeatedly for the same find result. IF(NOT ${pkg}_FIND_QUIETLY) + STRING(REPLACE "\n" "\\n" details "${details}") SET(DETAILS_VAR FIND_PACKAGE_MESSAGE_DETAILS_${pkg}) IF(NOT "${details}" STREQUAL "${${DETAILS_VAR}}") # The message has not yet been printed.