> 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
_______________________________________________
Powered by www.kitware.com

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

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

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

Reply via email to