summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Schmelzer2011-11-03 11:59:29 +0100
committerSebastian Schmelzer2011-11-03 11:59:29 +0100
commitfad02aac975dd444e23ee740495fb46359571100 (patch)
tree70c4684e7244b0aca7ff3695ed65df9250568aa1
parenttransfer (diff)
downloadlibChooser-fad02aac975dd444e23ee740495fb46359571100.tar.gz
libChooser-fad02aac975dd444e23ee740495fb46359571100.tar.xz
libChooser-fad02aac975dd444e23ee740495fb46359571100.zip
some doku
-rw-r--r--INSTALL17
-rw-r--r--src/CMakeLists.txt46
-rw-r--r--src/Config.h.in5
-rw-r--r--src/Defaults.h25
-rw-r--r--src/VSessionHandler.cpp2
5 files changed, 60 insertions, 35 deletions
diff --git a/INSTALL b/INSTALL
index e69de29..1b93888 100644
--- a/INSTALL
+++ b/INSTALL
@@ -0,0 +1,17 @@
+To build libChooser from source follow these steps:
+ $ mkdir build
+ $ cd build
+ $ cmake <path/to/source> # you can add parameters here: -DDEBUG=1 for example
+ $ make
+ $ sudo make install
+
+List of configurable parameters with their default values:
+
+ DEBUG unset
+ LIBCHOOSER_BIN_PATH "/var/opt/openslx/bin"
+ LIBCHOOSER_ETC_BASE_PATH "/etc/vmchooser"
+ LIBCHOOSER_VMPATH "/var/lib/virt"
+ LIBCHOOSER_X_SESSIONS_PATH "/usr/share/xsessions"
+
+To change one of these parameters you have to append -D<VARIABLE>=<VALUE> when
+calling cmake. \ No newline at end of file
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4bedb99..bb6e99e 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,13 +1,26 @@
-include(${QT_USE_FILE})
+### CONFIGURE ##################################################################
+
+set(LIBCHOOSER_BIN_PATH "/var/opt/openslx/bin")
+set(LIBCHOOSER_ETC_BASE_PATH "/etc/vmchooser")
+set(LIBCHOOSER_VMPATH "/var/lib/virt")
+set(LIBCHOOSER_X_SESSIONS_PATH "/usr/share/xsessions")
+
+configure_file("Version.h.in" "Version.h")
+configure_file("libChooser.pc.in" "libChooser.pc")
+configure_file("Config.h.in" "Config.h")
+
+
+
+### INCLUDES ###################################################################
+
+include_directories("/usr/include" "${CMAKE_CURRENT_BINARY_DIR}")
set(QT_USE_QTXML TRUE)
set(QT_USE_QTSVG TRUE)
include(${QT_USE_FILE})
-configure_file("Version.h.in" "Version.h")
-configure_file("libChooser.pc.in" "libChooser.pc")
-configure_file("Config.h.in" "Config.h")
+QT4_WRAP_CPP(LCHOOSER_MOC_SOURCES ${LCHOOSER_MOC_HEADERS})
set(LCHOOSER_MOC_HEADERS "SessionTreeModel.h")
set(LCHOOSER_MOC_SOURCES "SessionTreeModel.cpp")
@@ -15,20 +28,35 @@ set(LCHOOSER_HEADERS "Session.h" "SessionTreeItem.h" "VSession.h" "VSessionHandl
set(LCHOOSER_SOURCES "SessionTreeItem.cpp" "VSession.cpp" "VSessionHandler.cpp" "XSession.cpp" "XSessionHandler.cpp")
set(LCHOOSER_CONFIG_HEADERS "Version.h" "Config.h")
-QT4_WRAP_CPP(LCHOOSER_MOC_SOURCES ${LCHOOSER_MOC_HEADERS})
+
+
+### BUILD ######################################################################
add_library (Chooser_static STATIC ${LCHOOSER_SOURCES} ${LCHOOSER_MOC_SOURCES} ${LCHOOSER_HEADERS} ${LCHOOSER_MOC_HEADERS} ${LCHOOSER_CONFIG_HEADERS})
set_target_properties (Chooser_static PROPERTIES OUTPUT_NAME Chooser)
add_library (Chooser_shared SHARED ${LCHOOSER_SOURCES} ${LCHOOSER_MOC_SOURCES} ${LCHOOSER_HEADERS} ${LCHOOSER_MOC_HEADERS} ${LCHOOSER_CONFIG_HEADERS})
set_target_properties (Chooser_shared PROPERTIES OUTPUT_NAME Chooser)
+
+
+### INSTALL ####################################################################
+
install(TARGETS Chooser_static Chooser_shared
LIBRARY DESTINATION lib COMPONENT libs
ARCHIVE DESTINATION lib COMPONENT libs
)
-install(FILES ${LCHOOSER_MOC_HEADERS} ${LCHOOSER_HEADERS} DESTINATION include/libChooser COMPONENT dev)
-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libChooser.pc" DESTINATION "share/pkgconfig" COMPONENT libs)
+install(FILES ${LCHOOSER_MOC_HEADERS} ${LCHOOSER_HEADERS}
+ DESTINATION include/libChooser COMPONENT dev
+)
+
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libChooser.pc"
+ DESTINATION "share/pkgconfig" COMPONENT libs
+)
+
+
+
+### BUILD PACKAGE ##############################################################
set(CPACK_COMPONENTS_ALL libs dev)
set(CPACK_COMPONENT_LIBS_DISPLAY_NAME "libChooser")
@@ -43,7 +71,7 @@ execute_process(COMMAND lsb_release -cs OUTPUT_VARIABLE distro_shortname OUTPUT_
execute_process(COMMAND arch OUTPUT_VARIABLE distro_arch OUTPUT_STRIP_TRAILING_WHITESPACE)
set(CPACK_GENERATOR "DEB")
-set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Sebastian Schmelzer <ssc@xss.nu>") #required
+set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Sebastian Schmelzer <ssc@xss.nu>")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Library for vmchooser and emuchooser..")
set(CPACK_PACKAGE_DESCRIPTION "Library for vmchooser and emuchooser..")
set(CPACK_PACKAGE_VERSION "${libChooser_VERSION_MAJOR}.${libChooser_VERSION_MINOR}.${libChooser_VERSION_PATCH}")
@@ -55,5 +83,5 @@ set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "${distro_arch}")
set(CPACK_PACKAGE_FILE_NAME "libChooser_${CPACK_PACKAGE_VERSION}_${distro_shortname}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "libChooser_${CPACK_PACKAGE_VERSION}")
-
INCLUDE(CPack)
+################################################################################ \ No newline at end of file
diff --git a/src/Config.h.in b/src/Config.h.in
index 31381b0..daa9a54 100644
--- a/src/Config.h.in
+++ b/src/Config.h.in
@@ -2,5 +2,10 @@
#define CONFIG_H
#cmakedefine DEBUG @DEBUG@
+#cmakedefine LIBCHOOSER_BIN_PATH "LIBCHOOSER_BIN_PATH"
+#cmakedefine LIBCHOOSER_ETC_BASE_PATH "LIBCHOOSER_ETC_BASE_PATH"
+#cmakedefine LIBCHOOSER_VMPATH "LIBCHOOSER_VMPATH"
+
+#cmakedefine LIBCHOOSER_X_SESSIONS_PATH "LIBCHOOSER_X_SESSIONS_PATH"
#endif //CONFIG_H
diff --git a/src/Defaults.h b/src/Defaults.h
deleted file mode 100644
index d168248..0000000
--- a/src/Defaults.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (c) 2010,2011 - RZ Uni Freiburg
- * Copyright (c) 2010,2011 - OpenSLX Project
- *
- * This program/file is free software distributed under the GPL version 2.
- * See http://gpl.openslx.org/
- *
- * If you have any feedback please consult http://feedback.openslx.org/ and
- * send your feedback to feedback@openslx.org
- *
- * General information about OpenSLX - libChooser can be found under
- * http://openslx.org
- *
- */
-
-#ifndef CHOOSERDEFAULTS_H_
-#define CHOOSERDEFAULTS_H_
-
-#define LIBCHOOSER_BIN_PATH "/var/opt/openslx/bin"
-#define LIBCHOOSER_ETC_BASE_PATH "/etc/vmchooser"
-#define LIBCHOOSER_VMPATH "/var/lib/virt"
-
-#define LIBCHOOSER_X_SESSIONS_PATH "/usr/share/xsessions"
-
-#endif /* CHOOSERDEFAULTS_H_ */
diff --git a/src/VSessionHandler.cpp b/src/VSessionHandler.cpp
index bda85d0..bce0bed 100644
--- a/src/VSessionHandler.cpp
+++ b/src/VSessionHandler.cpp
@@ -24,7 +24,7 @@
#include <QDebug>
#include <QDomDocument>
-#include "Defaults.h"
+#include "Config.h"
#include "Session.h"
#include "VSession.h"