[CMake] Fwd: Re: Need cmake help for MacOsX

Jerome Vernet vernet.jerome at wanadoo.fr
Fri May 21 17:38:22 EDT 2010


Thanks for your help. Things are better, but far from perfect, see below

Le 21/05/10 22:34, Werner Smekal a écrit :
>
> Hi Jerome,
>
> On 5/21/10 4:42 PM, Jérôme VERNET wrote:
>    
> # copy SDL frameworks into app bundle for Mac OS X
> if(APPLE)
> 	INSTALL(DIRECTORY /Users/smekal/Library/Frameworks/SDL.framework
> 					DESTINATION xrick.app/Contents/Frameworks)
> 	INSTALL(DIRECTORY /Users/smekal/Library/Frameworks/SDL_mixer.framework
> 					DESTINATION xrick.app/Contents/Frameworks)
> 	INSTALL(DIRECTORY /Users/smekal/Library/Frameworks/SDL_ttf.framework
> 					DESTINATION xrick.app/Contents/Frameworks)
> endif(APPLE)
>
>    
I tried that.
if(ENABLE_OSX_BUNDLE)
     message("***Install for MacOsX***")
     install(TARGETS hatari BUNDLE DESTINATION /Applications)
     INSTALL(DIRECTORY /Library/Frameworks/SDL.framework
                     DESTINATION 
/Applications/hatari.app/Contents/Resources)
     INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/gui-osx/French.lproj 
DESTINATION /Applications/hatari.app/Contents/Resources/)
     INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/gui-osx/English.lproj 
DESTINATION /Applications/hatari.app/Contents/Resources/)
endif(ENABLE_OSX_BUNDLE)

It worked. Great.

But... it's awfull ! Hard coded links (may be the path to SDL Framework 
can be found, there is PATH variable somewhere)... Need to do make 
install.... As the project have also other library, docs, etc...

I though that cmake can handle, automatically, all these things, but 
cannot find how... May be not.
> I don't know where the localized resource should go into (resource
> directory?), but again e.g. I do:
>    
Yes.
> if(APPLE)
> 	add_executable(
> 		xrick MACOSX_BUNDLE
> 			${xrick_SRCS}
> 			${xrick_data}
> 			${xrick_RSRCS}
> 	)
>
> 	# Mac OS X bundle specific settings
> 	set(MACOSX_BUNDLE true)
> 	set(MACOSX_BUNDLE_BUNDLE_NAME xrick)
> 	set(MACOSX_BUNDLE_INFO_STRING "xrick ${xrick_VERSION}")
> 	set(MACOSX_BUNDLE_LONG_VERSION_STRING "${xrick_VERSION}")
> 	set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${xrick_VERSION}")
> 	set(MACOSX_BUNDLE_BUNDLE_VERSION "${xrick_VERSION}")
>    set(MACOSX_BUNDLE_ICON_FILE xrick.icns)
>
>    # paths for data files in bundle
>    set_source_files_properties(
>      ${xrick_RSRCS}
>      PROPERTIES
>        MACOSX_PACKAGE_LOCATION Resources
>    )
>    set_source_files_properties(
>      ${xrick_data}
>      PROPERTIES
>        MACOSX_PACKAGE_LOCATION MacOS
>    )
> endif(APPLE)
>
> Resources etc. get copied in to the app bundle "automatically".
>
>
>    
That's not working with folder. Hélas....
>
> Read the BundleUtilities.cmake module in the cmake.app - there is a lot
> of documentation. Short example
>
>    
Cannot understand all what is supposed to do "fix_bundle", but, sure, 
it's not finished. Yes, it does copy Library and Framework (i test it), 
but do not work with SDL. And do not handle Localized Resources....
>
> make two build directories. in one run cmake with
>
>    
How do you do that ? I tried to change the Binaries path in CMake GUI, 
got 1234 errors....
> cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_OSX_ARCHITECTURES=i386 ..
>
> and in the other
>
> cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=i386;ppc ..
>    

I'll be back to XCode project as fast as I try to fix Hatari cmake build 
system.



Jerome
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100521/fa102c50/attachment.htm>


More information about the CMake mailing list