Notes |
|
(0017480)
|
Bill Hoffman
|
2009-09-14 15:24
|
|
But, that would make it harder to parse them and manipulate them in Cmake. |
|
|
(0017482)
|
Johannes Wienke
|
2009-09-14 15:36
|
|
Hm, that's true. What about providing two separate variables, one with the list as it is now and one that can be used as compiler flags? Or another solution would be to provide a macro that directly transforms the list into a string. |
|
|
(0019505)
|
Igor Baldachini
|
2010-02-10 05:01
|
|
In CMake FAQ there is:
Why do I have unwanted semicolons ; in my compiler flags?
CMake has a list data type. A list is stored as a string of semicolon-separated list elements. Whitespace separated arguments to a SET statement are interpreted as list elements. For instance, SET(var a b c d e) will give "var" a value of a;b;c;d;e and this list can be used by other CMake commands. However, if you pass ${var} to a non-CMake external tool, such as a compiler's command line, you are passing a;b;c;d;e which is not what you want. Instead you either need to pass "${var}", so that the list will be converted to a whitespace-separated string, or you need to SET(var "a b c d e") in the 1st place so that you're working with a string, not a list.
Then I expect that:
pkg_check_modules(ELEMENTARY elementary)
message(${ELEMENTARY_CFLAGS})
message("${ELEMENTARY_CFLAGS}")
1. prints a list with semicolon -> message(${ELEMENTARY_CFLAGS})
2. prints a list with whitespace -> message("${ELEMENTARY_CFLAGS}")
But the output result is
1. a list without semicolon and without whitespace -> message(${ELEMENTARY_CFLAGS})
-I/usr/local/include-I/usr/local/include/elementary-I/usr/local/include/eina-0-I/usr/local/include/eina-0/eina-I/usr/include/glib-2.0-I/usr/lib/glib-2.0/include-I/usr/include/lua5.1-I/usr/include/freetype2
2. a list with semicolon -> message("${ELEMENTARY_CFLAGS}")
-I/usr/local/include;-I/usr/local/include/elementary;-I/usr/local/include/eina-0;-I/usr/local/include/eina-0/eina;-I/usr/include/glib-2.0;-I/usr/lib/glib-2.0/include;-I/usr/include/lua5.1;-I/usr/include/freetype2
So the conversion dos not take place and the use of variable without quotation marks removes the semi-colon. |
|
|
(0041506)
|
Kitware Robot
|
2016-06-10 14:27
|
|
Resolving issue as `moved`.
This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page. |
|