[CMake] Ensuring not building for 64-bit

ML mailinglists at MailNewsRSS.com
Mon Aug 17 10:41:55 EDT 2009


Hi All,

I am running into some issues with some Carbon stuff that is not avail  
under 64-bit, but is for 32-but.

Items like:

framework/CP_Types.h(304): error: identifier "CIconHandle" is undefined
  	typedef CIconHandle				OSColorIcon;			// Mac CIcon

But I am doing in CP_Types.h:

#if TARGET_OS_MAC || (__APPLE__)
	#include <Carbon/Carbon.h>
#endif

#if TARGET_OS_MAC || (__APPLE__)
	typedef Handle					OSMenuBar;				// Handle to Mac Menu Bar
	typedef MenuRef					OSMenu;					// Opaque reference to Mac Menu
	typedef WindowRef				OSWindow;				// Opaque reference to Mac Window
	typedef Handle					OSHandle;				// Mac Handle
	typedef ControlRef				OSControl;				// Opaque reference to Mac Control
	typedef Ptr						OSPtr;					// Mac memory Ptr
	typedef SInt16					OSFileRef;				// Mac file reference number
	typedef IconRef					OSIconRef;				// Mac IconRef
	typedef FSVolumeRefNum 			OSVolume;				// Mac volume ref num
	typedef WindowClass 			OSWindowClass;			// Mac WindowClass
	
	typedef CGContextRef			OSCGContextRef;			// Mac Quartz context ref

	typedef DataBrowserItemID		OSDataBrowserItemID;		// DataBrowser item id
	typedef DataBrowserPropertyID	OSDataBrowserPropertyID;	// DataBrowser  
property id
	typedef DataBrowserItemDataRef	OSDataBrowserItemDataRef;	//  
DataBrowserItemDataRef

	#pragma warning "TODO -- No QuickDraw for what OS 10.5???"
	typedef GrafPtr					OSGraphicsPort;			// Mac GrafPtr
	typedef GWorldPtr				OSImageList;			// Mac GWorld containing images
	typedef CIconHandle				OSColorIcon;			// Mac CIcon
	typedef Handle					OSIconSuite;			// Mac Icon Suite Handle
	typedef PicHandle				OSPicture;				// Mac Picture Handle
	typedef RgnHandle				OSRegion;				// Mac Region
#endif

I must be missing something fundamental here.

CIconHandle is avail, but not under 64-bit. Which leads me to believe  
that I am doing something wrong in my CMakeLists.

I have an initial cache of:

# Apple Specific
set (CMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk)
set (CMAKE_OSX_DEPLOYMENT_TARGET=10.4)
set (CMAKE_OSX_ARCHITECTURES="i386;ppc")

Then in my CMakeLists.txt I have enclosed in an iF(APPLE):

set (CMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk)
set (CMAKE_OSX_DEPLOYMENT_TARGET=10.4)
set (CMAKE_OSX_ARCHITECTURES="i386;ppc")

# 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 )

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

I obviously run CMake as: cmake -Cinitialcache.cmake .

Everything works as expected in XCode.

If anyone has any thoughts I would appreciate them.

-Jason





More information about the CMake mailing list