I want to move some cmake command to a funtion . But the command did not work in the function.
I test a file command and it works well directly in the CMakeLists.txt but not in the function abcde.
So what's wrong with the function?
function(abcde)
file(GLOB_RECURSE SOURCE_FILES src4/*.cpp)
endfunction()
# file(GLOB_RECURSE SOURCE_FILES src4/*.cpp)
abcde()
Weird is that the function works well in the past few days and suddenly did not work. And my function has a few commands, some work and others don't work.
I use vs code and it's cmake tools extension.