return : “fred D:/ftarroux/scoop/apps/gdb/current/bin/sqlite3.exe”
and i want D:/ftarroux/Documents/FRED/BaseGit/simbox_externalProject/install/Windows-MSVC-1916-Win32/sqlite/bin/sqlite3.exe
If called from within a find module or any other script loaded by a call to find_package(<PackageName>), search prefixes unique to the current package being found. Specifically, look in the <PackageName>_ROOT CMake variable and the <PackageName>_ROOT environment variable. The package root variables are maintained as a stack, so if called from nested find modules or config packages, root paths from the parent’s find module or config package will be searched after paths from the current module or package. In other words, the search order would be <CurrentPackage>_ROOT, ENV{<CurrentPackage>_ROOT}, <ParentPackage>_ROOT, ENV{<ParentPackage>_ROOT}, etc. This can be skipped if NO_PACKAGE_ROOT_PATH is passed or by setting the CMAKE_FIND_USE_PACKAGE_ROOT_PATH to FALSE. See policy CMP0074.
Are you calling find_program from a find module or a script loaded by find_package? You made no indication of such in your original post, and it seemed you’re just calling it from your CMakeLists.txt file.
Oh, good catch. I didn’t realize that its usage was context-sensitive for other find_XXX calls. If that is the case, the _ROOT probably needs to lose the bin suffix.