Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: dominate on February 05, 2018, 12:14:04 pm

Title: How to use the compiler that I want in cmake generated project?
Post by: dominate on February 05, 2018, 12:14:04 pm
Please help with this:

https://stackoverflow.com/questions/48621242/unable-to-use-specific-compiler-in-cmake-created-codeblocks-project

Thank you.
Title: Re: How to use the compiler that I want in cmake generated project?
Post by: stahta01 on February 05, 2018, 12:19:23 pm
http://wiki.codeblocks.org/index.php/Installing_a_supported_compiler#Compiler-neutral_setup_steps (http://wiki.codeblocks.org/index.php/Installing_a_supported_compiler#Compiler-neutral_setup_steps)
Title: Re: How to use the compiler that I want in cmake generated project?
Post by: dominate on February 05, 2018, 12:49:48 pm
Have you ever read my post?
Title: Re: How to use the compiler that I want in cmake generated project?
Post by: 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.
Title: Re: How to use the compiler that I want in cmake generated project?
Post by: stahta01 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.
Title: Re: How to use the compiler that I want in cmake generated project?
Post by: oBFusCATed 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.