CMAKE_HOST_EXECUTABLE_SUFFIX is needed
CMAKE_EXECUTABLE_SUFFIX
corresponds to executable suffix on target platform but it can be something completely different from the executable suffix in the host's environment. For example, CMAKE_EXECUTABLE_SUFFIX
when building for Emscripten can be either .html
or .js
. Other examples, cross-compiling for Windows on Linux and vice versa.
Having single CMAKE_EXECUTABLE_SUFFIX
(without CMAKE_HOST_EXECUTABLE_SUFFIX
) makes it difficult to maintain consistent find_program(FOO_COMMNAD "foo${CMAKE_EXECUTABLE_SUFFIX}")
for host programs.