On 2013-10-09 07:44, Johannes Zarl wrote:
I guess you search for something like this:

function(info)
     set(msg)
     foreach(i RANGE ${ARGC})
         set(msg "${msg}${ARGV${i}}")
     endforeach()
     message(STATUS "[info] ${msg}")
endfunction()

message("Foo:bar;baz space" "FOO")
info("Foo:bar;baz space" "FOO")
message(two words)
info(two words)

....which yields the following output:

Foo:bar;baz spaceFOO
-- [info] Foo:bar;baz spaceFOO
twowords
-- [info] twowords

The "IN LISTS" signature of foreach seems to do additional list splitting,
leading to ("foo;bar" "baz") appearing as 3 elements. Accessing the ARGV array
by the positional indices (e.g. ${ARGV0}) prevents the splitting.

Really? That... is surprising. I thought the whole point of 'IN LISTS' was to take a variable that already contains a list and NOT do additional splitting (the way 'foreach(NAME ${LIST})' would)...

--
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

Reply via email to