override discovered assember

_find_compiler_path() does not consider CMAKE_PREFIX_PATH. ok, so be it.

However, it also ignores PATH in the environment. argh.

I’m using the gnu toolchain (gcc+binutils) and gcc happily finds a different assembler if I make sure it is first in my $PATH. (Of course for other things like cc1 that it finds through its internal mechanism, it needs to be told where (-B or GCC_EXEC_PREFIX) if you want different versions.)

Shouldn’t cmake find tools via the environment? So that they are more easily overridden?

I’m building a package that I downloaded, not writing my own, so I desire not to modify the supplied CMakeLists.txt, where I could set CMAKE_ASM-ATT_COMPILER) directly.

So I set the ASM-ATT env variable and this works. The problem here is that hyphens are not legal characters in POSIX env var names. The ‘env’ program will set this env var name (so, problem solved), however zsh will not.

So there are 3 things for consideration:

  1. shouldn’t CMAKE_PREFIX_PATH be used for finding toolchain components?
  2. shouldn’t $PATH be used for same?
  3. don’t require use of illegal env var names.