From ef937ae2e65b3aac5ef08313e8ffd9f2b498e4d0 Mon Sep 17 00:00:00 2001 From: Sebastian Schmelzer Date: Thu, 3 Nov 2011 15:53:35 +0100 Subject: update cmake stuff --- src/CMakeLists.txt | 44 +++++++++++++++++++++++++++++++------------- src/Dialog.cpp | 1 - src/Dialog.h | 6 ++---- src/main.cpp | 16 ---------------- 4 files changed, 33 insertions(+), 34 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 56e280e..14cc2a7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,13 +1,4 @@ -set(QT_USE_QTXML TRUE) -set(QT_USE_QTWEBKIT TRUE) - -include(${QT_USE_FILE}) - -file(GLOB_RECURSE EMUCHOOSER_RESOURCES "*.qrc") - -include_directories("/usr/include" "${CMAKE_CURRENT_BINARY_DIR}") - -################ +### CONFIGURE ################################################################## set(EMUCHOOSER_PLUGIN_PATH "/opt/openslx/plugin-repo/emuchooser") set(EMUCHOOSER_BIN_PATH "/var/opt/openslx/bin") @@ -21,24 +12,51 @@ set(EMUCHOOSER_DEFAULT_HEIGHT "580") configure_file("Version.h.in" "Version.h") configure_file("Config.h.in" "Config.h") -set(LCHOOSER_CONFIG_HEADERS "Version.h" "Config.h") -####### + +### INCLUDES ################################################################### + +set(QT_USE_QTXML TRUE) +set(QT_USE_QTWEBKIT TRUE) + +include(${QT_USE_FILE}) + +find_package(PkgConfig) +pkg_check_modules(LCHOOSER libChooser) + +include_directories("/usr/include" "${CMAKE_CURRENT_BINARY_DIR}" "${LCHOOSER_INCLUDE_DIRS}") + +set(EMUCHOOSER_CONFIG_HEADERS "Version.h" "Config.h") set(EMUCHOOSER_HEADERS "Globals.h") set(EMUCHOOSER_SOURCES "main.cpp" "Globals.cpp") set(EMUCHOOSER_MOC_HEADERS "Dialog.h" "JavaScriptInterface.h") set(EMUCHOOSER_MOC_SOURCES "Dialog.cpp" "JavaScriptInterface.cpp") +file(GLOB_RECURSE EMUCHOOSER_RESOURCES "*.qrc") + QT4_WRAP_CPP(EMUCHOOSER_MOC_SOURCES ${EMUCHOOSER_MOC_HEADERS}) QT4_ADD_RESOURCES(EMUCHOOSER_RC_SOURCES ${EMUCHOOSER_RESOURCES}) + + +### BUILD ###################################################################### + + add_executable (emuchooser ${EMUCHOOSER_SOURCES} ${EMUCHOOSER_MOC_SOURCES} ${EMUCHOOSER_RC_SOURCES} ${EMUCHOOSER_HEADERS} ${EMUCHOOSER_MOC_HEADERS}) -target_link_libraries(emuchooser "-lchooser" ${QT_LIBRARIES}) +target_link_libraries(emuchooser ${QT_LIBRARIES} ${LCHOOSER_LDFLAGS} ) + + + +### INSTALL #################################################################### INSTALL(TARGETS emuchooser RUNTIME DESTINATION bin) + + +### BUILD PACKAGE ############################################################## + set(CPACK_GENERATOR "DEB") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Sebastian Schmelzer ") #required set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "emuchooser") diff --git a/src/Dialog.cpp b/src/Dialog.cpp index 43f5cc5..bc6a5a3 100644 --- a/src/Dialog.cpp +++ b/src/Dialog.cpp @@ -19,7 +19,6 @@ #include #include -#include #include //#include "QChooserTreeView.h" diff --git a/src/Dialog.h b/src/Dialog.h index e547fca..56786d3 100644 --- a/src/Dialog.h +++ b/src/Dialog.h @@ -18,7 +18,6 @@ #include #include -#include class QTextEdit; class QTextBrowser; @@ -47,12 +46,11 @@ class Dialog : public QDialog void addItems(const QList entries); private: -//void createHeader(); void createLayout(); QString readStyle(const QString &filename); - QVBoxLayout *layout; - JavaScriptInterface* jsi; + QVBoxLayout *layout; + JavaScriptInterface *jsi; }; diff --git a/src/main.cpp b/src/main.cpp index 697ae64..839aa43 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -39,13 +39,9 @@ int main(int argc, char *argv[]) vh->setFilterScript(filterScript + ".disabled"); vh->setRunVmScript(runVmScript); -// qDebug() << vSessionPath; - /* read session files */ QList vsessions(vh->readXmlDir(vSessionPath)); -// qDebug() << vsessions.size(); - Dialog *w = new Dialog; if (vsessions.size()) { @@ -61,18 +57,6 @@ int main(int argc, char *argv[]) w->addItems(vsessions); } - - -// qDebug() << vsessions.size(); -// -// int i; -// for(i=0; iicon(); -// qDebug() << vsessions.at(i)->shortDescription(); -// qDebug() << vsessions.at(i)->description(); -// } -// w->addItems(vsessions, a.translate("Dialog", "Virtual Sessions")); - w->center(); w->show(); -- cgit v1.2.3-55-g7522