Re: [CMake] General question about variable scope.

2019-06-14 Thread Chuck Atkins
So, a couple things: string(TOUPPER ${lib} lib_upper) > set(WITH_LIB_${lib_upper}_EXAMPLES "") > > This needs to be outside the foreach loop. It's getting reset to empty on every iteration rather than accumulating results list(APPEND ${WITH_LIB_${lib_upper}_

[CMake] General question about variable scope.

2019-06-04 Thread Steven Truppe
Hi everyone, i've the following code: macro(bsBuildLibExamples lib) # get all examples get_cmake_property(_vars VARIABLES) foreach(_var ${_vars}) string(TOUPPER ${lib} lib_upper) set(WITH_LIB_${lib_upper}_EXAMPLES "") if(_var MATCHES "