Sunday, 11 January 2015

Regarding use of list(APPEND FOO_VAR "foo_value") in cmake

Although CMake's performance-tuning suggestions seem to imply that the following two statements are equivalent:

list(APPEND FOO_VAR "foovalue")
set(FOO_VAR "${FOO_VAR} foovalue")

They are in fact, not equivalent. This should have been a no-brainer, but I figured CMake lists were faked. I was wrong. Don't fall into this trap in your own projects.

Also, I'm glad to see CMake's documentation has at least improved compared to five years ago. It used to be nonexistent, and you were told to buy their book if you wanted documentation.

No comments :

Post a Comment