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)
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
│