Closed nhanders closed 2 years ago
Here are some possible solutions:
I found a pretty trivial solution on SO.
Instead of:
verbose_message(${sources})
Enclose the variable in inverted commas:
verbose_message("${sources}")
This isn't perfect since it doesn't print with delimiters (despite what the SO post says), but instead prints it as one long string.
Print each item in the list with a foreach
statement:
foreach(source IN LISTS headers)
verbose_message("* ${source}")
endforeach()
I'm in favour of solution 2. It is verbose, but since I'm using the verbose_message
command, I'm wanting a verbose output.
I will create a PR for this when I get a moment this week.
Hello! Thank you a lot for submitting this issue. I was also working with the second solution, as, for me, it seems like the better of the two. With a check before so we don't go through the foreach
loop if verbose messaging is toggled off.
I would also like to extend my gratitude for your kindness of wishing to submit a PR. Since I have some free time at the moment, I will make the fix now, but, please, feel free to submit any PRs you would wish and I will look over them. Once I push the commit I will let you know, so you can confirm it fixes it on your end as well.
Done, pushed the fix. Please confirm it works, whenever you can, or reopen if it doesn't. Thanks again!
Describe the bug In the projects
CMakeLists.txt
, there are calls to:verbose_message(${sources})
verbose_message(${exe_sources})
verbose_message(${headers})
where the variables are lists set in
SourcesAndHeaders.cmake
.However, when the messages are displayed in the console, only the first file is displayed in the list. E.g. if you have multiple sources, only the first file will be displayed.
To Reproduce Steps to reproduce the behavior:
Expected behavior Should display all the values in a list.