[CMake] add_custom_target dependency list issue
Szilárd Páll
szilard.pall at cbr.su.se
Sun Sep 26 19:48:38 EDT 2010
> No black magic, just cmake's rules about variable contents.
> Basically CMake has only 1 type of variable value, thats a string. What
> you created above is a string variable "DEPS" with the value "dep1 dep2
> dep3", i.e. a single string consisting of 3 words separated by spaces.
> Some strings are considered to be a list if you use a cmake command that
> expects a list, these strings need to separate each list entry with a
> semicolon.If you use
Actually I knew about the rules on variable contents as well as the
structure and generation on lists. However I didn't realize that
set(DEPS "dep1 dep2 dep3")
add_dependencies(foo bar
${DEPS})
is not pretty much the same as:
add_dependencies(target-name depend-target1
depend-target2 ...),
which is straight from the documentation.
This is what tricked me and I still think it's counter intuitive, but
after all, it's not the first time cmake makes me sweat with some
trivial stuff :)
I'm realizing that CMake probably generates a list of targets straight
from the command invocation and works on that later on. The/my
confusion roots in the quite weird way that can be used to create
lists (set(var elem1 elem2...)). Correct me if I'm wrong, though!
Thanks a bunch for enlightening me!
Regards,
--
Szilárd
More information about the CMake
mailing list