CMAKECXXCOMPILER
CMAKE_CXX_COMPILER is a CMake variable used to specify the C++ compiler that should be used for building a project. It is a cache variable that holds the path to the C++ compiler executable and can be set by the user through command line options, such as -DCMAKE_CXX_COMPILER, or by editing the CMake cache in an existing build directory.
When configuring a project, CMake relies on this variable to determine the C++ toolchain. If the variable
CMAKE_CXX_COMPILER is specific to the C++ language; there is a separate CMAKE_C_COMPILER for C. In multi-language
Changing the compiler after an initial configuration typically requires reconfiguring the project or starting a new
Example: cmake -S . -B build -DCMAKE_CXX_COMPILER=/usr/bin/clang++.