summaryrefslogtreecommitdiffstats
path: root/Modules/FindPackageMessage.cmake
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2011-09-02 18:37:39 (GMT)
committerDavid Cole <david.cole@kitware.com>2011-09-02 18:37:49 (GMT)
commitcd81da30f7477b5653665608f4de5f4a4a0e1a14 (patch)
treec7d740a58a6d0477bfd1c8527610b9cb13714ed8 /Modules/FindPackageMessage.cmake
parent0ae78b76d544adad4860b66bdd6279fdde07ea34 (diff)
downloadCMake-cd81da30f7477b5653665608f4de5f4a4a0e1a14.zip
CMake-cd81da30f7477b5653665608f4de5f4a4a0e1a14.tar.gz
CMake-cd81da30f7477b5653665608f4de5f4a4a0e1a14.tar.bz2
FindPackageMessage: Eliminate new lines using REGEX REPLACE
Re-fix problem exposed by recent commit to FindPythonInterp. If the find "details" has new lines in it, then replace them with the empty string so that the string may be saved as a cache entry that can be re-read next time CMake runs. Use REGEX REPLACE, and replace with an empty string, eliminating the problem characters, so that we may easily extend this to include additional problem characters in the future if necessary.
Diffstat (limited to 'Modules/FindPackageMessage.cmake')
-rw-r--r--Modules/FindPackageMessage.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/FindPackageMessage.cmake b/Modules/FindPackageMessage.cmake
index 5afee3e..48d3472 100644
--- a/Modules/FindPackageMessage.cmake
+++ b/Modules/FindPackageMessage.cmake
@@ -34,7 +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}")
+ STRING(REGEX REPLACE "[\n]" "" details "${details}")
SET(DETAILS_VAR FIND_PACKAGE_MESSAGE_DETAILS_${pkg})
IF(NOT "${details}" STREQUAL "${${DETAILS_VAR}}")
# The message has not yet been printed.