On 5/29/2021 2:06 PM, Peter Dimov via Boost wrote:
Edward Diener wrote:
Thanks, Peter, but how do I tell CMake to use a particular compiler ? In b2 I specify the toolset on the b2 command line. In CMake I specify what ?
There are various ways to control that but the easiest is to set the CC and CXX environment variables (on POSIX platforms.)
Again, when on Windows, things are a bit different. There you need to specify the toolset with -T when using the default Visual Studio generator (or select a generator with -G.)
https://cmake.org/cmake/help/v3.20/manual/cmake.1.html
CMake's philosophy is very different from b2's.
I do not see how specifying a -G some_generator chooses a compiler. I assume each generator has its own way of choosing a compiler but I can not find any CMake documentation for how to determine this for the command line. Is this something programmers just guess at or is there actual documentation on how what command line parameters configure a particular generator for a particular compiler ? I am being a bit facetious but I am truly amazed at how anyone uses CMake on Windows with any generator which is not Visual C++. Even with the Visual C++ generators I can not find any documentation for the specific -T toolsets, not that I would want to choose any but the default anyway, for a given Visual C++ generator. Anyone ?