# Give the project a nice name; optional (used for an IDE) PROJECT (simple_qt_remote) # Include this CMake module to get most of the settings needed to build # It assumes that player ist installed in /use/local SET (CMAKE_MODULE_PATH /usr/local/share/cmake/Modules) INCLUDE (UsePlayerC++) # Looks up Qt4 and sets vital variables... FIND_PACKAGE(Qt4 REQUIRED) # ... such as QT_USE_FILE, a cmake script to prepare the compiler INCLUDE(${QT_USE_FILE}) # without the no_keyword option, Qt's signal macro clashes with Boost.Signals # One has to use 'Q_SIGNALS' and 'Q_SLOTS' instead of 'signals' and 'slots' ADD_DEFINITIONS(-DQT_NO_KEYWORDS) # create a variable with all the source files -- nicer then a big list # after SOURCES in PLAYER_ADD_PLAYERCPP_CLIENT SET( REMOTE_SOURCES main.cpp remote.cpp robot.cpp ) # all files containing the Q_OBJECT macro (for classes that define # signals/slots) have to be processed by moc. SET( REMOTE_MOC_SOURCES robot.h ) # the generated moc files need to be added to the source list MESSAGE("FOO ${REMOTE_SOURCES}") QT_WRAP_CPP(remote REMOTE_SOURCES ${REMOTE_MOC_SOURCES}) MESSAGE("BAR ${REMOTE_SOURCES}") # This will create a player client program 'remote' from in REMOTE_SOURCES PLAYER_ADD_PLAYERCPP_CLIENT(remote SOURCES ${REMOTE_SOURCES}) #ADD_EXECUTABLE(remote ${REMOTE_SOURCES}) # link the program 'remote' also against Qt TARGET_LINK_LIBRARIES(remote ${QT_LIBRARIES})