News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

How to use the compiler that I want in cmake generated project?

Started by dominate, February 05, 2018, 12:14:04 PM

Previous topic - Next topic

stahta01

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]


BlueHazzard

simple answer: you can not do this.

The codeblocks projects generated by cmake are so called "makefile" projects. In this mode all settings within the ide are ignored and everything is taken from the makefile.

stahta01

Quote from: BlueHazzard on February 05, 2018, 02:34:18 PM
simple answer: you can not do this.

The codeblocks projects generated by cmake are so called "makefile" projects. In this mode all settings within the ide are ignored and everything is taken from the makefile.

I do believe that the PATH system variable (as modified by Code::Blocks) is used; that is why I suggest changing the toolchain.
Because it is possible it is a PATH system variable related issue.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

oBFusCATed

Try running cmake with CMAKE_CXX_COMPILER and CMAKE_C_COMPILER variables set instead of CC and CXX.
Another option is probably to use the envrionment variable plugin to set CC and CXX, but I don't think this is a good idea.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]