If on Windows and an executable “hello.exe” or “hello.com” exists, then CMake will find it. CMake would NOT find “hello.exe” on non-Windows platforms, where no file suffix is expected.
find_program(v NAMES hello)
Shell scripts of any file suffix on any operating system are found iff:
- script file executable flag is set (find_program general requirement)
- script file suffix is specified as part of NAMES parameter
A complete standalone example: