[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cmake
Subject:    [CMake] multi-line strings... is this expected?
From:       Matthew Woehlke <mw_triad () users ! sourceforge ! net>
Date:       2014-03-27 17:54:04
Message-ID: lh1ojd$8nm$1 () ger ! gmane ! org
[Download RAW message or body]

I have ¹ a CTest like:

execute_process(...)
set(expected "
...text...
...text...
")
string(REGEX MATCH ${expected} match ${out})

So, basically, I'm checking that the process outputs a certain set of 
lines, and taking advantage of multi-line strings in CTest script for 
convenience and readability.

This works great... *IF* the script file has UNIX line endings. I'm 
wondering if that is expected? It seems that CTest must be processing 
the script in binary mode in order for the string to contain '\r' 
characters...

(I don't need the obvious work-around ². I'm asking if this is expected 
and e.g. if I should file a bug report...)

I haven't tested exhaustively but this may not affect all versions of 
CMake. (Noticed on 2.8.11.1.)

( ¹ 
https://github.com/commontk/AppLauncher/blob/master/Testing/CMake/AppLauncher-Settings-TestEnvironment.cmake)


( ² 
https://github.com/mwoehlke-kitware/AppLauncher/tree/test-multi-line-string-fixes)

-- 
Matthew

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: \
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information \
on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at \
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic