Re: [CMake] How to append a string on list inside a function

2018-09-27 Thread Marc CHEVRIER
Using a cache variable seems not required. A function creates a new scope and inherit a copy of all variables defined in the upper scope. So, by adding a set command using PARENT_SCOPE in your function you can update the variable in the parent scope: function(addTest targetName)

[CMake] How to append a string on list inside a function

2018-09-27 Thread Romain LEGUAY
Hello everyone, I try to append a string (target name) on a list inside a function called in other CMakeLists. I have the following project’s tree: ├── CMakeLists.txt ├── test ├── CMakeLists.txt └── app ├── CMakeLists.txt ├── appA │ ├── CMakeLists.txt │