summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Schmelzer2011-11-03 15:53:35 +0100
committerSebastian Schmelzer2011-11-03 15:53:35 +0100
commitef937ae2e65b3aac5ef08313e8ffd9f2b498e4d0 (patch)
tree9e05337a14b919091a36f538ab0e4b8a3f8acd4c
parentinitial commit (diff)
downloademuchooser-ef937ae2e65b3aac5ef08313e8ffd9f2b498e4d0.tar.gz
emuchooser-ef937ae2e65b3aac5ef08313e8ffd9f2b498e4d0.tar.xz
emuchooser-ef937ae2e65b3aac5ef08313e8ffd9f2b498e4d0.zip
update cmake stuff
-rw-r--r--src/CMakeLists.txt44
-rw-r--r--src/Dialog.cpp1
-rw-r--r--src/Dialog.h6
-rw-r--r--src/main.cpp16
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 <ssc@xss.nu>") #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 <QRect>
#include <QWebView>
-#include <SessionTreeItem.h>
#include <VSession.h>
//#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 <QDialog>
#include <Session.h>
-#include <SessionTreeModel.h>
class QTextEdit;
class QTextBrowser;
@@ -47,12 +46,11 @@ class Dialog : public QDialog
void addItems(const QList<Session *> 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<Session*> 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; i<vsessions.size(); i++) {
-// qDebug() << vsessions.at(i)->icon();
-// qDebug() << vsessions.at(i)->shortDescription();
-// qDebug() << vsessions.at(i)->description();
-// }
-// w->addItems(vsessions, a.translate("Dialog", "Virtual Sessions"));
-
w->center();
w->show();