Hello,
I’m having trouble making my function FIND_THIRD_PARTY_LIB work.
Inside it I call find_file but the parameter holding the result doesn’t renew apparently because
If the full path to a file is found the result is stored in the variable and the search will not be repeated unless the variable is cleared.
function(LS_FIND_THIRD_PARTY_LIB name return_path )
** execute_process( **
** COMMAND ls -r -1 …/…/…/3rdParty/${name} **
** OUTPUT_VARIABLE out_dirs**
** OUTPUT_STRIP_TRAILING_WHITESPACE**
** )**
** string(REPLACE “\n” “;” l1 ${out_dirs})**
** list (GET l1 0 HEAD)**
** find_file(var_return NAMES “lib${return_path}.a” PATHS “…/…/…/…/…/3rdParty/${name}/${HEAD}/macOS” NO_CACHE NO_DEFAULT_PATH)**
** set(${return_path} ${var_return} PARENT_SCOPE)**
endfunction()
So basically after each call of that function var_return is the same (the very first result)
Please help, perhaps I’m doing something wrong with the variable settings? Or perhaps it’s impossible to use find_file like that?