Linking against OS X Frameworks

classic Classic list List threaded Threaded
32 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Linking against OS X Frameworks

Jason Todd Slack-Moehrle
HI All,

I am continuing my learning curve.

Consider this block:

if (APPLE)
                SET(MOREFILESX_HEADERS
                        source/thirdparty/OSX/MoreFilesX/MoreFilesX.h
                )
       
                SET(MOREFILESX_SOURCES
                        source/thirdparty/OSX/MoreFilesX/MoreFilesX.c
                )
               
                FIND_LIBRARY (CARBON_LIBRARY Carbon)
                MARK_AS_ADVANCED (CARBON_LIBRARY)
                SET (EXTRA_LIBS ${CARBON_LIBRARY})
               
                ADD_LIBRARY (MoreFilesX ${MOREFILESX_SOURCES} ${MOREFILESX_HEADERS})
                TARGET_LINK_LIBRARIES (MoreFilesX ${EXTRA_LIBS} )
ENDIF (APPLE)

I am trying to link against the Carbon Framework. I know it is not  
working because I am getting errors like:

/Volumes/Data/jtsm/Checkout/Universal GUI/source/thirdparty/OSX/
MoreFilesX/MoreFilesX.c: In function ‘FSGetVolParms’:
/Volumes/Data/jtsm/Checkout/Universal GUI/source/thirdparty/OSX/
MoreFilesX/MoreFilesX.c:231: error: ‘HParamBlockRec’ undeclared (first  
use in this function)

What am I doing wrong above?

Best,

-Jason
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Linking against OS X Frameworks

Michael Jackson
Not sure if this helps but from the FindQt4.cmake file there is the  
following:

IF(Q_WS_MAC)
     SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} "-
framework Carbon")

     # Qt 4.0, 4.1, 4.2 use QuickTime
     IF(QT_VERSION_MINOR LESS 3)
       SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} "-
framework QuickTime")
     ENDIF(QT_VERSION_MINOR LESS 3)

     # Qt 4.2+ use AppKit
     IF(QT_VERSION_MINOR GREATER 1)
       SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} "-
framework AppKit")
     ENDIF(QT_VERSION_MINOR GREATER 1)

     SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} "-
framework ApplicationServices")
   ENDIF(Q_WS_MAC)

Also is that a linker error or a compile error? Looks like a compile  
error. You probably have to include the location of the Carbon Headers.


_________________________________________________________
Mike Jackson                  [hidden email]
BlueQuartz Software                    www.bluequartz.net
Principal Software Engineer                  Dayton, Ohio



On Aug 6, 2009, at 3:41 PM, ML wrote:

> HI All,
>
> I am continuing my learning curve.
>
> Consider this block:
>
> if (APPLE)
> SET(MOREFILESX_HEADERS
> source/thirdparty/OSX/MoreFilesX/MoreFilesX.h
> )
>
> SET(MOREFILESX_SOURCES
> source/thirdparty/OSX/MoreFilesX/MoreFilesX.c
> )
>
> FIND_LIBRARY (CARBON_LIBRARY Carbon)
> MARK_AS_ADVANCED (CARBON_LIBRARY)
> SET (EXTRA_LIBS ${CARBON_LIBRARY})
>
> ADD_LIBRARY (MoreFilesX ${MOREFILESX_SOURCES} ${MOREFILESX_HEADERS})
> TARGET_LINK_LIBRARIES (MoreFilesX ${EXTRA_LIBS} )
> ENDIF (APPLE)
>
> I am trying to link against the Carbon Framework. I know it is not  
> working because I am getting errors like:
>
> /Volumes/Data/jtsm/Checkout/Universal GUI/source/thirdparty/OSX/
> MoreFilesX/MoreFilesX.c: In function ‘FSGetVolParms’:
> /Volumes/Data/jtsm/Checkout/Universal GUI/source/thirdparty/OSX/
> MoreFilesX/MoreFilesX.c:231: error: ‘HParamBlockRec’ undeclared  
> (first use in this function)
>
> What am I doing wrong above?
>
> Best,
>
> -Jason
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Linking against OS X Frameworks

Michael Jackson

_________________________________________________________
Mike Jackson                  [hidden email]
BlueQuartz Software                    www.bluequartz.net
Principal Software Engineer                  Dayton, Ohio



On Aug 6, 2009, at 3:52 PM, ML wrote:

> Hey Mike,
>
>> Also is that a linker error or a compile error? Looks like a  
>> compile error. You probably have to include the location of the  
>> Carbon Headers.
>
> What is the best way to do that exactly? I am in cluding Carbon/
> Carbon.h in my source files. but I guess CMAKE needs to know where  
> to fine them too. moving form XCode is harder than I thought it  
> would be.
>
> -Jason
>

include_directories (${CMAKE_OSX_SYSROOT}/Developer/Headers/FlatCarbon)

Then in your code you can do #include <Carbon.h>

Although I am not really sure this is the "correct" way to do this.

I think you should be really looking for the "Carbon.framework" and  
then using that..

Mike
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Linking against OS X Frameworks

Jason Todd Slack-Moehrle
Hi Mike,

>>> Also is that a linker error or a compile error? Looks like a  
>>> compile error. You probably have to include the location of the  
>>> Carbon Headers.
>>
>> What is the best way to do that exactly? I am in cluding Carbon/
>> Carbon.h in my source files. but I guess CMAKE needs to know where  
>> to fine them too. moving form XCode is harder than I thought it  
>> would be.

> include_directories (${CMAKE_OSX_SYSROOT}/Developer/Headers/
> FlatCarbon)
>
> Then in your code you can do #include <Carbon.h>
>
> Although I am not really sure this is the "correct" way to do this.
>
> I think you should be really looking for the "Carbon.framework" and  
> then using that..

I am getting more confused! This works in XCode for me, it is just two  
files.

Does anyone have an example CMake file that includes Crbon headers,  
links agains the carbon framework, etc? What I am doing is obviously  
wrong.

This project is only two files and builds for me in XCode.

-Jason
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Linking against OS X Frameworks

Jason Todd Slack-Moehrle
Hi Michael,

Thank you for your reply.

>>>> What is the best way to do that exactly? I am in cluding Carbon/
>>>> Carbon.h in my source files. but I guess CMAKE needs to know  
>>>> where to fine them too. moving form XCode is harder than I  
>>>> thought it would be.
>>
>>> include_directories (${CMAKE_OSX_SYSROOT}/Developer/Headers/
>>> FlatCarbon)
>>>
>>> Then in your code you can do #include <Carbon.h>
>>>
>>> Although I am not really sure this is the "correct" way to do this.
>>>
>>> I think you should be really looking for the "Carbon.framework"  
>>> and then using that..
>>
>> I am getting more confused! This works in XCode for me, it is just  
>> two files.
>>
>> Does anyone have an example CMake file that includes Crbon headers,  
>> links agains the carbon framework, etc? What I am doing is  
>> obviously wrong


> I just tried it with CMake 2.6.3 and as you reported, find_library  
> finds Carbon.framework just fine, but the target_link_libraries  
> command just drops it again. IMHO, what it actually should do  
> (expressed in CMake-code) the following
>
>
> get_filename_component( FRAMEWORK_DIR ${CARBON_LIBRARY} PATH )
> get_filename_component( FRAMEWORK_NAME ${CARBON_LIBRARY} NAME_WE )
>
> set_target_properties( someTarget PROPERTIES
> COMPILE_FLAGS "-F ${FRAMEWORK_DIR}"
> LINK_FLAGS "-F ${FRAMEWORK_DIR} -framework ${FRAMEWORK_NAME}"
> )
>
>
> I.e. it should add the directory containing the framework to the  
> framework search path (such that things like #include <Carbon/
> Carbon.h> work) and then add "-framework Carbon" to the link command.
>
>
> Of course, if everything is installed in standard locations, this is  
> unnecessary...

I am running: cmake version 2.6-patch 4

I am confused still. you say if everything is installed in standard  
locations this is unnecessary. Yes, everything is a standard plain  
vanilla OS X install.

So everything you just did above is unnecessary then?

Here is what I have now:

        if (APPLE)
                SET(MOREFILESX_HEADERS source/thirdparty/OSX/MoreFilesX/MoreFilesX.h)
       
                SET(MOREFILESX_SOURCES source/thirdparty/OSX/MoreFilesX/MoreFilesX.c)
               
                FIND_LIBRARY (CARBON_LIBRARY Carbon.framework)
                MARK_AS_ADVANCED (CARBON_LIBRARY)
               
                get_filename_component( FRAMEWORK_DIR ${CARBON_LIBRARY} PATH )
                get_filename_component( FRAMEWORK_NAME ${CARBON_LIBRARY} NAME_WE )
               
                ADD_LIBRARY (MoreFilesX ${MOREFILESX_SOURCES} ${MOREFILESX_HEADERS})
                set_target_properties( MoreFilesX PROPERTIES
                 COMPILE_FLAGS "-F ${FRAMEWORK_DIR}"
                 LINK_FLAGS "-F ${FRAMEWORK_DIR} -framework ${FRAMEWORK_NAME}"
                )
               
        ENDIF (APPLE)

I still get the same compile errors as before. But works using Xcode  
for me.

Is there another resource as I can't find an example of these basic  
things on the wiki. Even Google searching is not really turning up  
much. I did find:http://www.vtk.org/Wiki/ 
CMake:HowToUseExistingOSXFrameworks which is how I structured my first  
example but alas nothing. Even for this list I few people replied with  
ideas none that seem to work.

I would appreciate pointers!

-Jason
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Linking against OS X Frameworks

Bill Hoffman
ML wrote:

> Hi Michael,
>
>
> I still get the same compile errors as before. But works using Xcode for
> me.
>
> Is there another resource as I can't find an example of these basic
> things on the wiki. Even Google searching is not really turning up much.
> I did find:http://www.vtk.org/Wiki/CMake:HowToUseExistingOSXFrameworks 
> which is how I structured my first example but alas nothing. Even for
> this list I few people replied with ideas none that seem to work.
>
> I would appreciate pointers!
>

Folks, CMake is framework aware.   You don't need to add the -F stuff.
You can either use a full path to a framework in include_directories or
in target_link_libraries.   Find_library will also find frameworks.

The following will work:

find_library(CARBON NAMES Carbon)
add_executable(foo foo.cxx)
target_link_libraries(foo ${CARBON})

-Bill
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Linking against OS X Frameworks

Michael Jackson

On Aug 7, 2009, at 9:30 AM, Bill Hoffman wrote:

> ML wrote:
>> Hi Michael,
>> I still get the same compile errors as before. But works using  
>> Xcode for me.
>> Is there another resource as I can't find an example of these basic  
>> things on the wiki. Even Google searching is not really turning up  
>> much. I did find:http://www.vtk.org/Wiki/CMake:HowToUseExistingOSXFrameworks 
>>  which is how I structured my first example but alas nothing. Even  
>> for this list I few people replied with ideas none that seem to work.
>> I would appreciate pointers!
>
> Folks, CMake is framework aware.   You don't need to add the -F  
> stuff. You can either use a full path to a framework in  
> include_directories or
> in target_link_libraries.   Find_library will also find frameworks.
>
> The following will work:
>
> find_library(CARBON NAMES Carbon)
> add_executable(foo foo.cxx)
> target_link_libraries(foo ${CARBON})
>
> -Bill

Not to beat a dead horse BUT I think there is a slight problem that am  
coming up against and I am sure there is simple line in the cmake file  
that I am missing:

project (MoreFilesX)
cmake_minimum_required(VERSION 2.6)
SET(MOREFILESX_HEADERS MoreFilesX.h)
SET(MOREFILESX_SOURCES MoreFilesX.c)
FIND_LIBRARY(CARBON_LIBRARY NAMES Carbon)
SET(EXTRA_LIBS ${CARBON_LIBRARY} )
ADD_LIBRARY (MoreFilesX ${MOREFILESX_SOURCES} ${MOREFILESX_HEADERS})
target_link_libraries(MoreFilesX ${EXTRA_LIBS})

This on its own will not allow a compilation of the source files. I  
had to add

CMAKE_C_FLAGS  -isysroot /Developer/SDKs/MacOSX10.4u.sdk

to the CMakeCache in order to generate a good Unix Makefile and/or  
Xcode project. So I must be missing something because CMake looks for  
and sets the CMAKE_OSX_SYSROOT variable on start up. My question is  
why wouldn't cmake add the -isysroot flags to the compiler command?

Mike Jackson
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Linking against OS X Frameworks

Jason Todd Slack-Moehrle
Hi All,

Continuing this conversation

>> Folks, CMake is framework aware.   You don't need to add the -F  
>> stuff. You can either use a full path to a framework in  
>> include_directories or
>> in target_link_libraries.   Find_library will also find frameworks.
>>
>> The following will work:
>>
>> find_library(CARBON NAMES Carbon)
>> add_executable(foo foo.cxx)
>> target_link_libraries(foo ${CARBON})

If I do this, I get my compile errors referencing lack of Carbon  
Framework like:

In file included from /Volumes/Data/jtsm/Checkout/Universal GUI/source/
thirdparty/OSX/MoreFilesX/MoreFilesX.c:82:
/Volumes/Data/jtsm/Checkout/Universal GUI/source/thirdparty/OSX/
MoreFilesX/MoreFilesX.h:1494: error: conflicting types for  
‘FSVolumeMount’
/System/Library/Frameworks/CoreServices.framework/Frameworks/
CarbonCore.framework/Headers/Files.h:7323: error: previous declaration  
of ‘FSVolumeMount’ was here
/Volumes/Data/jtsm/Checkout/Universal GUI/source/thirdparty/OSX/
MoreFilesX/MoreFilesX.c: In function ‘FSGetVolParms’:
/Volumes/Data/jtsm/Checkout/Universal GUI/source/thirdparty/OSX/
MoreFilesX/MoreFilesX.c:231: error: ‘HParamBlockRec’ undeclared (first  
use in this function)
/Volumes/Data/jtsm/Checkout/Universal GUI/source/thirdparty/OSX/
MoreFilesX/MoreFilesX.c:231: error: (Each undeclared identifier is  
reported only once

There is definitely something key that I am missing here...what is it?

-Jason

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Linking against OS X Frameworks

Michael Wild

On 8. Aug, 2009, at 0:33, ML wrote:

> Hi All,
>
> Continuing this conversation
>
>>> Folks, CMake is framework aware.   You don't need to add the -F  
>>> stuff. You can either use a full path to a framework in  
>>> include_directories or
>>> in target_link_libraries.   Find_library will also find frameworks.
>>>
>>> The following will work:
>>>
>>> find_library(CARBON NAMES Carbon)
>>> add_executable(foo foo.cxx)
>>> target_link_libraries(foo ${CARBON})
>
> If I do this, I get my compile errors referencing lack of Carbon  
> Framework like:
>
> In file included from /Volumes/Data/jtsm/Checkout/Universal GUI/
> source/thirdparty/OSX/MoreFilesX/MoreFilesX.c:82:
> /Volumes/Data/jtsm/Checkout/Universal GUI/source/thirdparty/OSX/
> MoreFilesX/MoreFilesX.h:1494: error: conflicting types for  
> ‘FSVolumeMount’
> /System/Library/Frameworks/CoreServices.framework/Frameworks/
> CarbonCore.framework/Headers/Files.h:7323: error: previous  
> declaration of ‘FSVolumeMount’ was here
> /Volumes/Data/jtsm/Checkout/Universal GUI/source/thirdparty/OSX/
> MoreFilesX/MoreFilesX.c: In function ‘FSGetVolParms’:
> /Volumes/Data/jtsm/Checkout/Universal GUI/source/thirdparty/OSX/
> MoreFilesX/MoreFilesX.c:231: error: ‘HParamBlockRec’ undeclared  
> (first use in this function)
> /Volumes/Data/jtsm/Checkout/Universal GUI/source/thirdparty/OSX/
> MoreFilesX/MoreFilesX.c:231: error: (Each undeclared identifier is  
> reported only once
>
> There is definitely something key that I am missing here...what is it?
>
> -Jason
>

This is a compile error, and has nothing to do with linking.

Problem is, you have FSVolumeMount declared in thirdparty/OSX/
MoreFilesX/MoreFilesX.c, which, however, is also a function in Carbon.  
So you have simple name clash. The issue you are facing might be that  
FSVolumeMount was introduced in Mac OSX 10.5, and the clash didn't  
happen on 10.4.

Michael
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Linking against OS X Frameworks

Jason Todd Slack-Moehrle
In reply to this post by Jason Todd Slack-Moehrle
Michael,

>>>> find_library(CARBON NAMES Carbon)
>>>> add_executable(foo foo.cxx)
>>>> target_link_libraries(foo ${CARBON})
>>
>> If I do this, I get my compile errors referencing lack of Carbon  
>> Framework like:
>>
>> In file included from /Volumes/Data/jtsm/Checkout/Universal GUI/
>> source/thirdparty/OSX/MoreFilesX/MoreFilesX.c:82:
>> /Volumes/Data/jtsm/Checkout/Universal GUI/source/thirdparty/OSX/
>> MoreFilesX/MoreFilesX.h:1494: error: conflicting types for  
>> ‘FSVolumeMount’
>> /System/Library/Frameworks/CoreServices.framework/Frameworks/
>> CarbonCore.framework/Headers/Files.h:7323: error: previous  
>> declaration of ‘FSVolumeMount’ was here
>
> This is a compile error, and has nothing to do with linking.
>
> Problem is, you have FSVolumeMount declared in thirdparty/OSX/
> MoreFilesX/MoreFilesX.c, which, however, is also a function in  
> Carbon. So you have simple name clash. The issue you are facing  
> might be that FSVolumeMount was introduced in Mac OSX 10.5, and the  
> clash didn't happen on 10.4.

But It works in XCode just fine, same code, nothing changed. I will  
send you the example I am trying to move to CMake so that you an see  
it. Maybe I am missing something being set in CMake to make it work.

-Jason

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Linking against OS X Frameworks

Jason Todd Slack-Moehrle
All,

Oh, umm, wait.  How do I specify the 10.4 Universal SDK? Maybe that is  
it where I specify it on XCode, but I see nothing in my CMake file  
that would select a particular SDK so would it be using 10.5  
automatically? How does CMake decide this?

Which would make Michael right that maybe this was introduced in 105.

Sorry for top posting, I thought it might be easier for the way the  
thread is going.

Thoughts?

-Jason



On Aug 8, 2009, at 7:05 AM, ML wrote:

> Michael,
>
>>>>> find_library(CARBON NAMES Carbon)
>>>>> add_executable(foo foo.cxx)
>>>>> target_link_libraries(foo ${CARBON})
>>>
>>> If I do this, I get my compile errors referencing lack of Carbon  
>>> Framework like:
>>>
>>> In file included from /Volumes/Data/jtsm/Checkout/Universal GUI/
>>> source/thirdparty/OSX/MoreFilesX/MoreFilesX.c:82:
>>> /Volumes/Data/jtsm/Checkout/Universal GUI/source/thirdparty/OSX/
>>> MoreFilesX/MoreFilesX.h:1494: error: conflicting types for  
>>> ‘FSVolumeMount’
>>> /System/Library/Frameworks/CoreServices.framework/Frameworks/
>>> CarbonCore.framework/Headers/Files.h:7323: error: previous  
>>> declaration of ‘FSVolumeMount’ was here
>>
>> This is a compile error, and has nothing to do with linking.
>>
>> Problem is, you have FSVolumeMount declared in thirdparty/OSX/
>> MoreFilesX/MoreFilesX.c, which, however, is also a function in  
>> Carbon. So you have simple name clash. The issue you are facing  
>> might be that FSVolumeMount was introduced in Mac OSX 10.5, and the  
>> clash didn't happen on 10.4.
>
> But It works in XCode just fine, same code, nothing changed. I will  
> send you the example I am trying to move to CMake so that you an see  
> it. Maybe I am missing something being set in CMake to make it work.
>
> -Jason
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Linking against OS X Frameworks

Michael Wild

On 8. Aug, 2009, at 16:08, ML wrote:

> All,
>
> Oh, umm, wait.  How do I specify the 10.4 Universal SDK? Maybe that  
> is it where I specify it on XCode, but I see nothing in my CMake  
> file that would select a particular SDK so would it be using 10.5  
> automatically? How does CMake decide this?
>
> Which would make Michael right that maybe this was introduced in 105.
>
> Sorry for top posting, I thought it might be easier for the way the  
> thread is going.
>
> Thoughts?
>
> -Jason
>

Yep, that would probably be it. What you have to do is setting  
CMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk and CMAKE_C_FLAGS='$
{CMAKE_C_FLAGS} -mmacosx-version-min=10.4'. Probably you have to add  
the same to all CMAKE_*_LINKER_FLAGS.

Below CMake code compiles MoreFilesX just fine (most of it is devoted  
to working around issue #6195 and checking that we use a suitable SDK  
and deployment target).

Michael


cmake_minimum_required( VERSION 2.6 )

project( MoreFilesX C )

# construct version if cmake version < 2.6.3
if( NOT DEFINED CMAKE_VERSION )
   set( CMAKE_VERSION "${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.$
{CMAKE_PATCH_VERSION}" )
endif( NOT DEFINED CMAKE_VERSION )

# figure out Mac OSX SDK version (do not care for the u-suffix in 10.4u)
get_filename_component( SDK_VER ${CMAKE_OSX_SYSROOT} NAME )
string( REPLACE ".sdk" "" SDK_VER ${SDK_VER} )
string( REPLACE "MacOSX" "" SDK_VER ${SDK_VER} )
string( REGEX REPLACE "[a-zA-Z]" "" SDK_VER ${SDK_VER} )
# this REALLY needs the 10.4 SDK.
if( ${SDK_VER} VERSION_GREATER 10.4 )
   message( SEND_ERROR "MoreFilesX requires the SDK version to be not  
newer than 10.4u (${SDK_VER} detected)" )
endif( ${SDK_VER} VERSION_GREATER 10.4 )

# solution to issue #6195 will hopefully make it into new versions of  
CMake
if( ${CMAKE_VERSION} VERSION_LESS 2.6.5 )
   # default CMAKE_OSX_DEPLOYMENT_TARGET to the SDK version
   set( CMAKE_OSX_DEPLOYMENT_TARGET ${SDK_VER} CACHE STRING
     "Minimum OS X version to target for deployment (at runtime);  
newer APIs weak linked. Set to empty string for default value." )
   foreach( var CMAKE_C_FLAGS CMAKE_CXX_FLAGS CMAKE_EXE_LINKER_FLAGS
       CMAKE_SHARED_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS )
     set( ${var} "${${var}} -mmacosx-version-min=$
{CMAKE_OSX_DEPLOYMENT_TARGET}" )
   endforeach( var )
endif( ${CMAKE_VERSION} VERSION_LESS 2.6.5 )

# this really needs 10.4 run-time compatibility
if( CMAKE_OSX_DEPLOYMENT_TARGET VERSION_GREATER 10.4 )
   message( SEND_ERROR "MoreFilesX requires  
CMAKE_OSX_DEPLOYMENT_TARGET to be not newer than 10.4" )
endif( CMAKE_OSX_DEPLOYMENT_TARGET VERSION_GREATER 10.4 )

# only want to find frameworks
set( CMAKE_FIND_FRAMEWORK ONLY )
find_library( CARBON_FRAMEWORK Carbon )

# here goes the "actual" stuff
set( MOREFILESX_HEADERS MoreFilesX.h )
set( MOREFILESX_SOURCES MoreFilesX.c )

add_library (MoreFilesX ${MOREFILESX_SOURCES} ${MOREFILESX_HEADERS} )

target_link_libraries (MoreFilesX ${CARBON_FRAMEWORK} )
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Linking against OS X Frameworks

Jason Todd Slack-Moehrle
Michael,

Thank you for this example! It was really informative. Definitely a  
missing piece in my knowledge thus far.

One question:

I get an error stating:

CMake Error at CMakeLists.txt:70 (message):
   MoreFilesX requires the SDK version to be not newer than 10.4u (10.6
   detected)

this comes from here:

> # figure out Mac OSX SDK version (do not care for the u-suffix in  
> 10.4u)
> get_filename_component( SDK_VER ${CMAKE_OSX_SYSROOT} NAME )
> string( REPLACE ".sdk" "" SDK_VER ${SDK_VER} )
> string( REPLACE "MacOSX" "" SDK_VER ${SDK_VER} )
> string( REGEX REPLACE "[a-zA-Z]" "" SDK_VER ${SDK_VER} )
> # this REALLY needs the 10.4 SDK.
> if( ${SDK_VER} VERSION_GREATER 10.4 )
>  message( SEND_ERROR "MoreFilesX requires the SDK version to be not  
> newer than 10.4u (${SDK_VER} detected)" )
> endif( ${SDK_VER} VERSION_GREATER 10.4 )

So how do I turn around and set 10.4u if it is not automatically  
detected?

It is like this:

CMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk

Best,

-Jason

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Linking against OS X Frameworks

Michael Wild

On 9. Aug, 2009, at 18:59, ML wrote:

> Michael,
>
> Thank you for this example! It was really informative. Definitely a  
> missing piece in my knowledge thus far.
>
> One question:
>
> I get an error stating:
>
> CMake Error at CMakeLists.txt:70 (message):
>  MoreFilesX requires the SDK version to be not newer than 10.4u (10.6
>  detected)
>
> this comes from here:
>
>> # figure out Mac OSX SDK version (do not care for the u-suffix in  
>> 10.4u)
>> get_filename_component( SDK_VER ${CMAKE_OSX_SYSROOT} NAME )
>> string( REPLACE ".sdk" "" SDK_VER ${SDK_VER} )
>> string( REPLACE "MacOSX" "" SDK_VER ${SDK_VER} )
>> string( REGEX REPLACE "[a-zA-Z]" "" SDK_VER ${SDK_VER} )
>> # this REALLY needs the 10.4 SDK.
>> if( ${SDK_VER} VERSION_GREATER 10.4 )
>> message( SEND_ERROR "MoreFilesX requires the SDK version to be not  
>> newer than 10.4u (${SDK_VER} detected)" )
>> endif( ${SDK_VER} VERSION_GREATER 10.4 )
>
> So how do I turn around and set 10.4u if it is not automatically  
> detected?
>
> It is like this:
>
> CMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk
>
> Best,
>
> -Jason
>

CMake by default detects the most current SDK. If you want to use a  
different one, you have to set it in the cache, by e.g. executing

cmake -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk -
DCMAKE_OSX_DEPLOYMENT_TARGET=10.4 .

in the build tree. Above command also sets  
CMAKE_OSX_DEPLOYMENT_TARGET=10.4 for consistency.

Please note that it is supported (and meaningful) to have different  
versions of the SDK and the deployment target (both of them may be  
newer than the other, so "all combinations allowed"). However, this  
has implications on compiling, linking and loading, which I can't  
remember just off the top of my head.

Michael
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Linking against OS X Frameworks

Michael Jackson
On Sun, Aug 9, 2009 at 3:07 PM, Michael Wild<[hidden email]> wrote:

>
> On 9. Aug, 2009, at 18:59, ML wrote:
>
>> Michael,
>>
>> Thank you for this example! It was really informative. Definitely a
>> missing piece in my knowledge thus far.
>>
>> One question:
>>
>> I get an error stating:
>>
>> CMake Error at CMakeLists.txt:70 (message):
>>  MoreFilesX requires the SDK version to be not newer than 10.4u (10.6
>>  detected)
>>
>> this comes from here:
>>
>>> # figure out Mac OSX SDK version (do not care for the u-suffix in 10.4u)
>>> get_filename_component( SDK_VER ${CMAKE_OSX_SYSROOT} NAME )
>>> string( REPLACE ".sdk" "" SDK_VER ${SDK_VER} )
>>> string( REPLACE "MacOSX" "" SDK_VER ${SDK_VER} )
>>> string( REGEX REPLACE "[a-zA-Z]" "" SDK_VER ${SDK_VER} )
>>> # this REALLY needs the 10.4 SDK.
>>> if( ${SDK_VER} VERSION_GREATER 10.4 )
>>> message( SEND_ERROR "MoreFilesX requires the SDK version to be not newer
>>> than 10.4u (${SDK_VER} detected)" )
>>> endif( ${SDK_VER} VERSION_GREATER 10.4 )
>>
>> So how do I turn around and set 10.4u if it is not automatically detected?
>>
>> It is like this:
>>
>> CMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk
>>
>> Best,
>>
>> -Jason
>>
>
> CMake by default detects the most current SDK. If you want to use a
> different one, you have to set it in the cache, by e.g. executing
>
> cmake -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk
> -DCMAKE_OSX_DEPLOYMENT_TARGET=10.4 .
>
> in the build tree. Above command also sets CMAKE_OSX_DEPLOYMENT_TARGET=10.4
> for consistency.
>
> Please note that it is supported (and meaningful) to have different versions
> of the SDK and the deployment target (both of them may be newer than the
> other, so "all combinations allowed"). However, this has implications on
> compiling, linking and loading, which I can't remember just off the top of
> my head.
>
> Michael

the CMAKE_OSX_DEPLOYMENT_TARGET setting controls the "Weak Linking"
that OS  X does. It basically says what the minimum version of OS X
your program can run on.


the CMAKE_OSX_SYSROOT setting controls the "maximum" version of OS X
that your program can run on. By setting BOTH to 10.4 you are
basically saying that your program can run ONLY on OS X 10.4. Is that
what you want?

If you link against a library that has a function in 10.5 that is not
in 10.4 then your program will likely crash. It is up to you to take
the necessary steps in your code to ensure this does not happen, maybe
by using an alternate function?

If you read bug number 6195 you will get all the detailed explanations
you need plus all the history that will allow you to make an informed
decision about how to set those values:

http://public.kitware.com/Bug/view.php?id=6195

Mike
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Linking against OS X Frameworks

Michael Wild

On 9. Aug, 2009, at 23:09, Mike Jackson wrote:

> On Sun, Aug 9, 2009 at 3:07 PM, Michael Wild<[hidden email]> wrote:
>>
>> On 9. Aug, 2009, at 18:59, ML wrote:
>>
>>> Michael,
>>>
>>> Thank you for this example! It was really informative. Definitely a
>>> missing piece in my knowledge thus far.
>>>
>>> One question:
>>>
>>> I get an error stating:
>>>
>>> CMake Error at CMakeLists.txt:70 (message):
>>>  MoreFilesX requires the SDK version to be not newer than 10.4u  
>>> (10.6
>>>  detected)
>>>
>>> this comes from here:
>>>
>>>> # figure out Mac OSX SDK version (do not care for the u-suffix in  
>>>> 10.4u)
>>>> get_filename_component( SDK_VER ${CMAKE_OSX_SYSROOT} NAME )
>>>> string( REPLACE ".sdk" "" SDK_VER ${SDK_VER} )
>>>> string( REPLACE "MacOSX" "" SDK_VER ${SDK_VER} )
>>>> string( REGEX REPLACE "[a-zA-Z]" "" SDK_VER ${SDK_VER} )
>>>> # this REALLY needs the 10.4 SDK.
>>>> if( ${SDK_VER} VERSION_GREATER 10.4 )
>>>> message( SEND_ERROR "MoreFilesX requires the SDK version to be  
>>>> not newer
>>>> than 10.4u (${SDK_VER} detected)" )
>>>> endif( ${SDK_VER} VERSION_GREATER 10.4 )
>>>
>>> So how do I turn around and set 10.4u if it is not automatically  
>>> detected?
>>>
>>> It is like this:
>>>
>>> CMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk
>>>
>>> Best,
>>>
>>> -Jason
>>>
>>
>> CMake by default detects the most current SDK. If you want to use a
>> different one, you have to set it in the cache, by e.g. executing
>>
>> cmake -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk
>> -DCMAKE_OSX_DEPLOYMENT_TARGET=10.4 .
>>
>> in the build tree. Above command also sets  
>> CMAKE_OSX_DEPLOYMENT_TARGET=10.4
>> for consistency.
>>
>> Please note that it is supported (and meaningful) to have different  
>> versions
>> of the SDK and the deployment target (both of them may be newer  
>> than the
>> other, so "all combinations allowed"). However, this has  
>> implications on
>> compiling, linking and loading, which I can't remember just off the  
>> top of
>> my head.
>>
>> Michael
>
> the CMAKE_OSX_DEPLOYMENT_TARGET setting controls the "Weak Linking"
> that OS  X does. It basically says what the minimum version of OS X
> your program can run on.
>
>
> the CMAKE_OSX_SYSROOT setting controls the "maximum" version of OS X
> that your program can run on. By setting BOTH to 10.4 you are
> basically saying that your program can run ONLY on OS X 10.4. Is that
> what you want?
>
> If you link against a library that has a function in 10.5 that is not
> in 10.4 then your program will likely crash. It is up to you to take
> the necessary steps in your code to ensure this does not happen, maybe
> by using an alternate function?
>
> If you read bug number 6195 you will get all the detailed explanations
> you need plus all the history that will allow you to make an informed
> decision about how to set those values:
>
> http://public.kitware.com/Bug/view.php?id=6195
>
> Mike

According to this document http://developer.apple.com/documentation/DeveloperTools/Conceptual/cross_development/Configuring/configuring.html

your information is partially wrong: CMAKE_OSX_SYSROOT gives you the  
maximum SDK version from which you can USE features at built time. All  
newer features will not be available. It doesn't say anything about  
run time.

CMAKE_OSX_DEPLOYMENT_TARGET, on the other hand, gives the minimum  
version required to run the application. All the symbols that fall in  
between these two versions (where CMAKE_OSX_DEPLOYMENT_TARGET has to  
be lower or equal to CMAKE_OSX_SYSROOT) are weakly linked, meaning  
their address is set to NULL and need to be tested at runtime whether  
they are available (described here http://developer.apple.com/documentation/DeveloperTools/Conceptual/cross_development/Using/using.html#/ 
/apple_ref/doc/uid/20002000-1114537-BABHHJBC and here http://developer.apple.com/technotes/tn2002/tn2064.html)
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Linking against OS X Frameworks

Jason Todd Slack-Moehrle
Hi Guys,

With all of your help and reading intensely though the documentation  
to understand each command. I am starting to really get this.

I am doing great now.

What is the command to force 32-bit carbon as now that I set 10.4 as  
my SDK and I am running on a 64 -bit machine I am getting errors like:

In file included from /Volumes/Data/jtsm/Checkout/Universal GUI/source/
thirdparty/OSX/MoreFilesX/MoreFilesX.c:80:
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/
Carbon.framework/Headers/Carbon.h:20:6: error: #error 64-bit not  
supported

I wish Apple had decided to support 64-bit Carbon, but that is another  
thread all together.

-Jason


On Aug 9, 2009, at 2:30 PM, Michael Wild wrote:

>
> On 9. Aug, 2009, at 23:09, Mike Jackson wrote:
>
>> On Sun, Aug 9, 2009 at 3:07 PM, Michael Wild<[hidden email]>  
>> wrote:
>>>
>>> On 9. Aug, 2009, at 18:59, ML wrote:
>>>
>>>> Michael,
>>>>
>>>> Thank you for this example! It was really informative. Definitely a
>>>> missing piece in my knowledge thus far.
>>>>
>>>> One question:
>>>>
>>>> I get an error stating:
>>>>
>>>> CMake Error at CMakeLists.txt:70 (message):
>>>> MoreFilesX requires the SDK version to be not newer than 10.4u  
>>>> (10.6
>>>> detected)
>>>>
>>>> this comes from here:
>>>>
>>>>> # figure out Mac OSX SDK version (do not care for the u-suffix  
>>>>> in 10.4u)
>>>>> get_filename_component( SDK_VER ${CMAKE_OSX_SYSROOT} NAME )
>>>>> string( REPLACE ".sdk" "" SDK_VER ${SDK_VER} )
>>>>> string( REPLACE "MacOSX" "" SDK_VER ${SDK_VER} )
>>>>> string( REGEX REPLACE "[a-zA-Z]" "" SDK_VER ${SDK_VER} )
>>>>> # this REALLY needs the 10.4 SDK.
>>>>> if( ${SDK_VER} VERSION_GREATER 10.4 )
>>>>> message( SEND_ERROR "MoreFilesX requires the SDK version to be  
>>>>> not newer
>>>>> than 10.4u (${SDK_VER} detected)" )
>>>>> endif( ${SDK_VER} VERSION_GREATER 10.4 )
>>>>
>>>> So how do I turn around and set 10.4u if it is not automatically  
>>>> detected?
>>>>
>>>> It is like this:
>>>>
>>>> CMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk
>>>>
>>>> Best,
>>>>
>>>> -Jason
>>>>
>>>
>>> CMake by default detects the most current SDK. If you want to use a
>>> different one, you have to set it in the cache, by e.g. executing
>>>
>>> cmake -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk
>>> -DCMAKE_OSX_DEPLOYMENT_TARGET=10.4 .
>>>
>>> in the build tree. Above command also sets  
>>> CMAKE_OSX_DEPLOYMENT_TARGET=10.4
>>> for consistency.
>>>
>>> Please note that it is supported (and meaningful) to have  
>>> different versions
>>> of the SDK and the deployment target (both of them may be newer  
>>> than the
>>> other, so "all combinations allowed"). However, this has  
>>> implications on
>>> compiling, linking and loading, which I can't remember just off  
>>> the top of
>>> my head.
>>>
>>> Michael
>>
>> the CMAKE_OSX_DEPLOYMENT_TARGET setting controls the "Weak Linking"
>> that OS  X does. It basically says what the minimum version of OS X
>> your program can run on.
>>
>>
>> the CMAKE_OSX_SYSROOT setting controls the "maximum" version of OS X
>> that your program can run on. By setting BOTH to 10.4 you are
>> basically saying that your program can run ONLY on OS X 10.4. Is that
>> what you want?
>>
>> If you link against a library that has a function in 10.5 that is not
>> in 10.4 then your program will likely crash. It is up to you to take
>> the necessary steps in your code to ensure this does not happen,  
>> maybe
>> by using an alternate function?
>>
>> If you read bug number 6195 you will get all the detailed  
>> explanations
>> you need plus all the history that will allow you to make an informed
>> decision about how to set those values:
>>
>> http://public.kitware.com/Bug/view.php?id=6195
>>
>> Mike
>
> According to this document http://developer.apple.com/documentation/DeveloperTools/Conceptual/cross_development/Configuring/configuring.html
>
> your information is partially wrong: CMAKE_OSX_SYSROOT gives you the  
> maximum SDK version from which you can USE features at built time.  
> All newer features will not be available. It doesn't say anything  
> about run time.
>
> CMAKE_OSX_DEPLOYMENT_TARGET, on the other hand, gives the minimum  
> version required to run the application. All the symbols that fall  
> in between these two versions (where CMAKE_OSX_DEPLOYMENT_TARGET has  
> to be lower or equal to CMAKE_OSX_SYSROOT) are weakly linked,  
> meaning their address is set to NULL and need to be tested at  
> runtime whether they are available (described here http://developer.apple.com/documentation/DeveloperTools/Conceptual/cross_development/Using/using.html#//apple_ref/doc/uid/20002000-1114537-BABHHJBC 
>  and here http://developer.apple.com/technotes/tn2002/tn2064.html)
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Linking against OS X Frameworks

Michael Wild

On 10. Aug, 2009, at 1:27, ML wrote:

> Hi Guys,
>
> With all of your help and reading intensely though the documentation  
> to understand each command. I am starting to really get this.
>
> I am doing great now.
>
> What is the command to force 32-bit carbon as now that I set 10.4 as  
> my SDK and I am running on a 64 -bit machine I am getting errors like:
>
> In file included from /Volumes/Data/jtsm/Checkout/Universal GUI/
> source/thirdparty/OSX/MoreFilesX/MoreFilesX.c:80:
> /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/
> Carbon.framework/Headers/Carbon.h:20:6: error: #error 64-bit not  
> supported
>
> I wish Apple had decided to support 64-bit Carbon, but that is  
> another thread all together.
>
> -Jason
>


Just set CMAKE_OSX_ARCHITECTURES to i368, ppc or if you want a  
universal binary, "i368;ppc"


Michael
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Linking against OS X Frameworks

Sean McBride
In reply to this post by Jason Todd Slack-Moehrle
On 8/9/09 9:59 AM, ML said:

>CMake Error at CMakeLists.txt:70 (message):
>   MoreFilesX requires the SDK version to be not newer than 10.4u (10.6
>   detected)

I have a recollection of that being true, but it's easy to change
MoreFiles to build with the new headers.  I have an old project that
uses the 10.5 SDK and the MoreFilesX code and it works fine.

>What is the command to force 32-bit carbon as now that I set 10.4 as  
>my SDK and I am running on a 64 -bit machine I am getting errors like:
>
>In file included from /Volumes/Data/jtsm/Checkout/Universal GUI/source/
>thirdparty/OSX/MoreFilesX/MoreFilesX.c:80:
>/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/
>Carbon.framework/Headers/Carbon.h:20:6: error: #error 64-bit not  
>supported

The 10.4 SDK does not support 64 bit development.  If you want to build
as 64 bit, you need to use the 10.5 SDK.

>I wish Apple had decided to support 64-bit Carbon, but that is another  
>thread all together.

Much of Carbon is available in 64 bit, but definitely not all.
MoreFilesX is largely obsolete and deprecated.  I suspect many of the
APIs it uses are unavailable in 64 bit.  Also, much of what MoreFiles
provided is now part of the file manager.  In fact, I think that's the
problem with the 10.4 SDK... one MoreFiles function became part of
Carbon's Files.h.

I'm curious why you want to use MoreFileX in a modern 64 bit app.  What
does it provide that is still helpful?

Lastly, discussion of 10.6 is verboten; discussing it violates your NDA.

--
____________________________________________________________
Sean McBride, B. Eng                 [hidden email]
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Linking against OS X Frameworks

Jason Todd Slack-Moehrle
In reply to this post by Michael Wild
Michael,

>> I wish Apple had decided to support 64-bit Carbon, but that is  
>> another thread all together.

> Just set CMAKE_OSX_ARCHITECTURES to i368, ppc or if you want a  
> universal binary, "i368;ppc"

Ah, it was the ';' that was I was missing. I was using a space

-Jason
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
12