CMAKE_MINIMUM_REQUIRED(VERSION 2.8) set(QT_USE_QTDECLARATIVE 1) FIND_PACKAGE(Qt4 REQUIRED) INCLUDE(${QT_USE_FILE}) INCLUDE_DIRECTORIES(${qtrapids_SOURCE_DIR}/src/include ${qtrapids_SOURCE_DIR}/src/plugins) FIND_LIBRARY(BOOST_SYSTEM boost_system-mt) IF(${BOOST_SYSTEM} STREQUAL BOOST_SYSTEM-NOTFOUND) MESSAGE(SEND_ERROR ${BOOST_SYSTEM}) ENDIF(${BOOST_SYSTEM} STREQUAL BOOST_SYSTEM-NOTFOUND) INCLUDE_DIRECTORIES( ${QT_INCLUDE_DIR} ${QT_QTTEST_INCLUDE_DIR} ${QT_QTDBUS} ${QT_QTGUI} ${QT_QTDECLARATIVE_INCLUDE_DIR} ) SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/proxy.cpp ${CMAKE_CURRENT_SOURCE_DIR}/proxy.h PROPERTIES GENERATED 1) SET(MOC_HEADERS ./models/QDeclarativeDownloadListModel.h ./models/QDeclarativeDownloadListModel_p.h # ./DownloadView.h # ./models/Plugin.h # ./MainWindow.h # ./PreferencesDialog.h # ./proxy.h # ./SeedView.h # ./ColumnSelectorDialog.h ) SET(SRC # ./DownloadView.cpp ./main.cpp ./models/QDeclarativeDownloadListModel.cpp # ./MainWindow.cpp # ./PreferencesDialog.cpp # ./proxy.cpp # ./SeedView.cpp # ./ColumnSelectorDialog.cpp ) # Set the resource files to be used. # Add all .qrc files here, that are needed. SET(RCCS qml/qml.qrc) # generate rules for building source files from the resources QT4_ADD_RESOURCES(RCC_SRC ${RCCS}) # generate rules for building source files that moc generates QT4_WRAP_CPP(QtApp_MOC_SRCS ${QtApp_MOCS}) QT4_WRAP_CPP(SRC ${MOC_HEADERS}) # Build the executable from these files: ADD_EXECUTABLE(qml-client ${SRC} ${MOC_HEADERS} ${RCC_SRC}) INSTALL(TARGETS qml-client DESTINATION bin) ADD_DEFINITIONS(-DQT_SHARED) set(QT_QTMAEMO5_LIBRARY -lQtMaemo5 -L${QT_LIBRARY_DIR}) # QT_QTMAEMO5_* variables are not defined by CMake if(NOT QT_QTMAEMO5_INCLUDE_DIR) FIND_PATH(QT_QTMAEMO5_INCLUDE_DIR QtMaemo5 PATHS ${QT_HEADERS_DIR}/QtMaemo5 NO_DEFAULT_PATH) endif(NOT QT_QTMAEMO5_INCLUDE_DIR) if(NOT QT_QTMAEMO5_LIBRARY) FIND_LIBRARY(QT_QTMAEMO5_LIBRARY QtMaemo5 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH) endif(NOT QT_QTMAEMO5_LIBRARY) TARGET_LINK_LIBRARIES(qml-client ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTDBUS_LIBRARY} ${QT_QTTEST_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY} -lboost_system-mt ) # Check if we are building under scratchbox and link with QtMaemo5 only in that case. # Thus, we maintain desktop build-ability also #set (SCRATCHBOX_UNAME $ENV{SBOX_UNAME_MACHINE}) if (SCRATCHBOX_UNAME) MESSAGE("Configuring for building under Scratchbox..") TARGET_LINK_LIBRARIES(qtrapids-gui ${QT_QTMAEMO5_LIBRARY}) endif (SCRATCHBOX_UNAME) #MESSAGE(${CMAKE_HOST_SYSTEM_PROCESSOR}) #CHECK_LIBRARY_EXISTS(QT_QTMAEMO5_LIBRARY) ADD_DEPENDENCIES(qtrapids-gui dbusapi)