[CMake] Version 2.8 affects exception handling?

Bill Spotz wfspotz at sandia.gov
Sat Nov 28 21:08:35 EST 2009


On Nov 28, 2009, at 11:40 AM, Bill Hoffman wrote:

> Bill Spotz wrote:
>
>> I finally got around to doing this, and the only difference in the
>> compile flags is that the new version of cmake uses the compiler flag
>>
>>    -mmacosx-version-min=10.5
>>
>> where the old one does not.  My MACOSX_DEPLOYMENT_TARGET environment
>> variable is set to 10.5 either way, so I'm not even sure this would  
>> make
>> a difference.
>>
>
> This is from these two bugs:
>
> http://public.kitware.com/Bug/view.php?id=9959
> http://public.kitware.com/Bug/view.php?id=6195
>
> If the user does not specify a deployment target, CMake should not use
> one.  As a rule we try to keep CMake as default as possible.   gcc -o
> foo foo.c should be the same as add_executable(foo foo.c).  In this  
> case
> that is not true...   Will come up with a fix for 2.8.1.   As a work
> around, I think if you do this set(CMAKE_OSX_DEPLOYMENT_TARGET "") it
> should stop CMake from adding the flag.


So set(CMAKE_OSX_DEPLOYMENT_TARGET "") doesn't seem to work: I am  
still getting the -mmacosx-version-min=10.5 compiler options.  I'm  
still not sure why this would cause the problems I am seeing, which  
are exceptions not getting caught.

I have constructed a smaller build, which makes it easier to find all  
of the differences.  I have also found linker options

     -L/sw/lib/gcc4.4/lib/gcc/i686-apple-darwin9/4.4.1
     -L/sw/lib/gcc4.4/lib
     -lgfortranbegin
     -lgfortran

when the epetra dynamic library gets linked under the new cmake and  
not the old.  This could be problematic because it is using the  
compiler /usr/bin/c++, which on my system is version 4.0.1 (although  
the gfortran compiler is version 4.4.1).

** Bill Spotz                                              **
** Sandia National Laboratories  Voice: (505)845-0170      **
** P.O. Box 5800                 Fax:   (505)284-0154      **
** Albuquerque, NM 87185-0370    Email: wfspotz at sandia.gov **




More information about the CMake mailing list