On 2014-04-24 04:53, Johannes Zarl wrote:
On Wednesday, 23. April 2014, 18:54:39, Matthew Woehlke wrote:
if (" ${arg}" STREQUAL " TOTO")
set(" TOTO" "evil")
You sure? When I checked, this did not work.
Are *you* sure? :-)
Also, the following gives me a syntax error:
message( "${ foo}")
Right; *explicit* expansion is limited in what characters are allowed.
As David Cole points out, you must expand such variables indirectly. Of
course, implicit expansion counts as indirect expansion, which is why
there is no safe character/prefix that can guarantee implicit expansion
won't occur.
(And - again as David Cole already noted - you didn't get an error in
the set() command, did you?)
See also
http://permalink.gmane.org/gmane.comp.programming.tools.cmake.devel/9936.
This is totally different, in that it uses an unsafe prefix.
No it doesn't. The point being made there (and here) is that *ANY*
prefix is unsafe. (Granted, some are more unsafe than others...)
On 2014-04-24 06:31, David Cole wrote:
I, for one, would fully support breaking backwards compatibility to fix
this, and be strict with variable and macro and function name
identifiers.
Of course, the *real* problem is implicit expansion. The permissiveness
of variable naming makes it harder to work around this, but would be
less of an issue if implicit expansion was less "eager".
--
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