Commit cd81da30 authored by David Cole's avatar David Cole

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.
parent 0ae78b76
......@@ -34,7 +34,7 @@
# Avoid printing a message repeatedly for the same find result.
STRING(REPLACE "\n" "\\n" details "${details}")
STRING(REGEX REPLACE "[\n]" "" details "${details}")
IF(NOT "${details}" STREQUAL "${${DETAILS_VAR}}")
# The message has not yet been printed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment