[CMake] OS X Carbon Rez...

Mike Jackson imikejackson at gmail.com
Tue Aug 1 12:49:52 EDT 2006


OK..
    So after the last bit of help I now have an executable that  
runs.. almost.. As with Carbon Apps on OS X I have to manually run:

/Developer/Tools/Rez Carbon.r -o ImageImporter

to allow any interaction.

Is it that I am forgetting to ling against a library? Like -F Carbon  
and -F ApplicationServices or do I have to put a CUSTOM_COMMAND in to  
run Rez..

Here is my CMakeLists.txt file for your viewing pleasure.

I would ask on a QT list but since I know that Paraview is being  
based on QT I am guessing that someone from Kitware really just can  
look at my CMakeLists.txt file and tell me where I messed up.

Thanks

--------
Mike Jackson
imikejackson <at> gmail <dot> com

########## BEGIN CMAKELISTS.TXT #####################

   # set project's name
   PROJECT( ImageImporter )

   # with SET() command you can change variables or define new ones
   # here we define SAMPLE_SRCS variable that contains a list of  
all .cpp files
   # note that we don't need \ at the end of line
   SET( SAMPLE_SRCS
        main.cpp
        ImageImporter.cpp
   )

   # another list, this time it includes all header files that should  
be treated with moc
   SET( SAMPLE_MOC_HDRS
        ImageImporter.h
   )

   # some .ui files
   SET( SAMPLE_UIS
        ImageImporter.ui
   )

   # and finally an resource file
   SET( SAMPLE_RCS

   )

   # enable warnings
   ADD_DEFINITIONS( -Wall )

   # by default only QtCore and QtGui modules are enabled
   # other modules must be enabled like this:
#  SET( QT_USE_QT3SUPPORT TRUE )
#  SET( QT_USE_QTXML TRUE )

   # this command finds Qt4 libraries and sets all required variables
   # note that it's Qt4, not QT4 or qt4
   FIND_PACKAGE( Qt4 REQUIRED )

   # add some useful macros and variables
   # (QT_USE_FILE is a variable defined by FIND_PACKAGE( Qt4 ) that  
contains a path to CMake script)
   INCLUDE( ${QT_USE_FILE} )

   # this command will generate rules that will run rcc on all files  
from SAMPLE_RCS
   # in result SAMPLE_RC_SRCS variable will contain paths to files  
produced by rcc
   QT4_ADD_RESOURCES( SAMPLE_RC_SRCS ${SAMPLE_RCS} )

   # this will run uic on .ui files:
   QT4_WRAP_UI( SAMPLE_UI_HDRS ${SAMPLE_UIS} )

   # and finally this will run moc:
   QT4_WRAP_CPP( SAMPLE_MOC_SRCS ${SAMPLE_MOC_HDRS} )

   # we need this to be able to include headers produced by uic in  
our code
   # (CMAKE_BINARY_DIR holds a path to the build directory, while  
INCLUDE_DIRECTORIES() works just like INCLUDEPATH from qmake)
   INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} )

   # here we instruct CMake to build "ImageImporter" executable from  
all of the source files
   ADD_EXECUTABLE( ImageImporter ${SAMPLE_SRCS} ${SAMPLE_MOC_SRCS} $ 
{SAMPLE_UI_HDRS} )

   # last thing we have to do is to tell CMake what libraries our  
executable needs,
   # luckily FIND_PACKAGE prepared QT_LIBRARIES variable for us:
   TARGET_LINK_LIBRARIES( ImageImporter ${QT_LIBRARIES} )





More information about the CMake mailing list