[CMake] Does CMake 3.3.1 ignore CXX env variable on OSX10.10?

Pere Mato Vila Pere.Mato at cern.ch
Tue Sep 22 11:53:50 EDT 2015


Thanks Nils. This explains it. So, the value of CXX is not honored.  

The problem we have, is that we record the compiler that we have used to build for runtime usage. If we make a binary distribution, this one will we used by clients that may have the compiler somewhere else.

Cheers,

		Pere
 

> On 22 Sep 2015, at 17:08, Nils Gladitz <nilsgladitz at gmail.com> wrote:
> 
> On 09/22/2015 04:43 PM, Pere Mato Vila wrote:
>> Hi Ben,
>> 
>>   Thanks, but in my case CXX is already a full path (/usr/bin/clang++). It is set like this
>> 
>>   export CXX=`which clang++`
>> 
>>   I do not understand how  /usr/bin/clang++ gets converted to /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
> 
>>> https://github.com/Kitware/CMake/commit/1f085e11e40a20f8e8702da7920e950e47deb27c
> 
> As the commit seems to explain the /usr/bin/clang++ binary is not the actual clang++ binary but rather an apple provided tool that delegates to the actual compiler depending on the current environment.
> 
> CMake runs "xcrun --find clang++" to find out which binary is currently the actual compiler.
> 
> This is done since CMake does not allow compilers to change once they have been configured given that this would invalidate information previously collected.
> 
> Nils
> 
> 

-------------------------------------------------------------
Pere Mato  CERN, PH Department, CH 1211 Geneva 23, Switzerland
	e-mail: pere.mato at cern.ch	tel:   +41 22 76 78696
	fax:  +41 22 76 68792		gsm: +41 75 41 10855



More information about the CMake mailing list