find_program not working correctly on Windows?
I am trying to use find_program
in a <package>Config.cmake
script, but I cannot get it to find the program. If I try to find it via find_file
, it works just fine.
find_file(MY_FILE_PATH my_program PATHS "D:/some/path/bin")
message(STATUS "my_program file path ${MY_FILE_PATH}")
find_program(MY_PROGRAM_PATH my_program PATHS "D:/some/path/bin")
message(STATUS "my_program program path ${MY_PROGRAM_PATH}")
And it prints
-- my_program file path D:/some/path/bin/my_program.exe
-- my_program program path
I'm calling once find_file
and then find_program
with the exact same arguments, but with find_program
it cannot locate my executable.
I am doing anything wrong? I would think that this is a bug? (I am using CMake 3.15.3)