在CMake中设置默认编译器 [英] Setting default compiler in CMake
本文介绍了在CMake中设置默认编译器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在WinXP SP3上使用CMake 2.8版。每当我默认运行CMake时,我都会使用Visual Studio 10编译器运行CMakeLists脚本。我试图做:
I'm using CMake version 2.8 on WinXP SP3. Whenever i run my CMakeLists script by default CMake use Visual Studio 10 compiler. I've tried to do:
SET( CMAKE_CXX_COMPILER "C:/MinGW/bin/g++" )
没有成功。如何将MinGW设置为默认编译器,这样我就不必担心在CMakeLists中设置编译器了?
without success. How can i set MinGW as my default compiler so that i do not have to worry about setting compiler in the CMakeLists?
推荐答案
With CMake 3.15版或更高版本,您可以设置 CMAKE_GENERATOR
环境变量,用于指定要在系统上使用的默认生成器。
With CMake version 3.15 or later, you can set the CMAKE_GENERATOR
environment variable to specify the default generator to be used on your system.
这篇关于在CMake中设置默认编译器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文