I am working on a template CMake file to use for future projects.
I for my part am a huge fan of clang, but I don't want to force everyone using my projects to use clang too.
The best case would be for it to simply work whatever compiler is present if clang isn't.
I found the following line, but in my test id didn't seem to do anything.
set(CMAKE_C_COMPILER_NAMES clang gcc icc cc)
set(CMAKE_CXX_COMPILER_NAMES clang++ g++ icpc c++ cxx)
What would be the best way to prioritize in the following order:
- clang
- gcc
- whatever is installed