[Cmake] How to use cmake to build qt applcation using qt/mac version

Andy Cedilnik andy.cedilnik at kitware.com
Wed, 25 Feb 2004 12:57:12 -0500


Hi,

The problem is that when building on mac you did not populate resource
fork or build a bundle. You can do both things, but they are both sort
of manual. 

For the fork part, you need to do the following:
IF(APPLE)
  FIND_PROGRAM(APPLE_RESOURCE Rez /Developer/Tools)
  IF(APPLE_RESOURCE)
    ADD_CUSTOM_COMMAND(
      TARGET myexecutable
      POST_BUILD
      COMMAND ${APPLE_RESOURCE}
      ARGS Carbon.r -o ${EXECUTABLE_OUTPUT_DIR}/myexecutable
      COMMENT "Resource Fork"
      )
  ENDIF(APPLE_RESOURCE)
ENDIF(APPLE)

The bundle is a bit more involved but also more correct. For that, look
in the CMake source in directory Source/WXDialog files CmakeLists.txt
and ReadMe.Mac.txt.

In CMakeLists.txt, you will find some big block:

IF(APPLE)
....
ENDIF(APPLE)

That is CMake specific, but you should be able to figure out how to do
it for your project.

			Andy


On Wed, 2004-02-25 at 12:37, Shunming Fang wrote:
> Hello, Guys,
> 
> I try to port my qt/linux  applications  to apple mac using qt/mac. I
> used cmake to build thos application under both linux and mac.
> Recompile is ok in MAC, but when I run those programs from terminal,
> they are weird because they didn˙t respond to mouse click or key hit.
> I check the qt maillist, one message told me I need to build those
> application as a bundle of MAC OS X application, then those
> application can possibly run correctly from Finder. It is a way for
> cmake to build qt application as mac os x application using qt/mac?
> 
> Thanks
> 
>