Author Topic: How to use the compiler that I want in cmake generated project?  (Read 430 times)


Offline stahta01

  • Lives here!
  • ****
  • Posts: 6221
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline dominate

  • Single posting newcomer
  • *
  • Posts: 2
Re: How to use the compiler that I want in cmake generated project?
« Reply #2 on: February 05, 2018, 12:49:48 pm »
Have you ever read my post?

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1846
Re: How to use the compiler that I want in cmake generated project?
« Reply #3 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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6221
    • My Best Post
Re: How to use the compiler that I want in cmake generated project?
« Reply #4 on: February 05, 2018, 05:50:12 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++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10837
    • Travis build status
Re: How to use the compiler that I want in cmake generated project?
« Reply #5 on: February 05, 2018, 05:56:10 pm »
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!]