aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheofilos Intzoglou <int.teo@gmail.com>2011-10-11 14:55:11 +0300
committerTheofilos Intzoglou <int.teo@gmail.com>2011-10-11 14:55:11 +0300
commitae40b3bc70886a26f6ec26fba31c30f23270ca8c (patch)
treee5e28a2556474e7f43404c1b298897cd45485d1b
parentadd a readme and a TODO (diff)
downloadc-portage-ae40b3bc70886a26f6ec26fba31c30f23270ca8c.tar.gz
c-portage-ae40b3bc70886a26f6ec26fba31c30f23270ca8c.tar.bz2
c-portage-ae40b3bc70886a26f6ec26fba31c30f23270ca8c.zip
A couple of fixes on the CMakeLists and change the test programs to use QCoreApplication instead of QApplication as GUI isn't necessary for the tests
-rw-r--r--src/CMakeLists.txt3
-rw-r--r--src/Qt/CMakeLists.txt7
-rw-r--r--src/Qt/qpackageproperties.h1
-rw-r--r--src/Qt/tests/CMakeLists.txt34
-rw-r--r--src/Qt/tests/qpackageproperties_test.cpp11
-rw-r--r--src/Qt/tests/qportagesettings_test.cpp10
6 files changed, 15 insertions, 51 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 22e27c7..3fb5b8b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -8,8 +8,9 @@ set(c-portage_SRCS dataconnect.c dict.c flag.c interpreter.c packageproperties.c
set(c-portage_HDRS dataconnect.h dict.h flag.h internal.h interpreter.h packageproperties.h stringlist.h)
add_library(c-portage SHARED ${c-portage_SRCS})
+target_link_libraries(c-portage ${PYTHON_LIBRARY})
add_executable(tester tester.c)
-target_link_libraries(tester c-portage ${PYTHON_LIBRARY})
+target_link_libraries(tester c-portage)
install(TARGETS c-portage DESTINATION lib)
install(FILES ${c-portage_HDRS} DESTINATION include/c-portage)
diff --git a/src/Qt/CMakeLists.txt b/src/Qt/CMakeLists.txt
index 3159bfc..b2849e8 100644
--- a/src/Qt/CMakeLists.txt
+++ b/src/Qt/CMakeLists.txt
@@ -2,12 +2,13 @@ find_package(Qt4 REQUIRED)
include_directories(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR})
remove_definitions(-std=c99)
-set(cpp-portage_SRCS qportagesettings.cpp qpackageproperties.cpp)
-set(cpp-portage_HDRS qportagesettings.h qpackageproperties.h)
+set(cpp-portage_SRCS qportagesettings.cpp qpackageproperties.cpp qlistconverter.cpp)
+set(cpp-portage_HDRS qportagesettings.h qpackageproperties.h qlistconverter.h)
QT4_WRAP_CPP(cpp-portage_MOC_SRCS ${cpp-portage_HDRS})
-add_library(cpp-portage qportagesettings.cpp ${cpp-portage_MOC_SRCS})
+add_library(cpp-portage SHARED qportagesettings.cpp ${cpp-portage_MOC_SRCS})
+target_link_libraries(cpp-portage c-portage ${QT_QTCORE_LIBRARY})
install(TARGETS cpp-portage DESTINATION lib)
install(FILES ${cpp-portage_HDRS} DESTINATION include/cpp-portage)
diff --git a/src/Qt/qpackageproperties.h b/src/Qt/qpackageproperties.h
index cfec142..fcda875 100644
--- a/src/Qt/qpackageproperties.h
+++ b/src/Qt/qpackageproperties.h
@@ -1,7 +1,6 @@
#ifndef QPACKAGEPROPERTIES_H
#define QPACKAGEPROPERTIES_H
-
#include <QObject>
#include "../packageproperties.h"
diff --git a/src/Qt/tests/CMakeLists.txt b/src/Qt/tests/CMakeLists.txt
index 9c10387..a2b1e28 100644
--- a/src/Qt/tests/CMakeLists.txt
+++ b/src/Qt/tests/CMakeLists.txt
@@ -1,34 +1,6 @@
-find_package(Qt4 REQUIRED)
-include_directories(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR})
-remove_definitions(-std=c99)
-
-set(cpp-portage-tests_SRCS qlistconverter_test.cpp qpackageproperties_test.cpp qportagesettings_test.cpp )
-
add_executable(QtWrapperTest test.cpp)
+target_link_libraries(QtWrapperTest cpp-portage)
add_executable(QPackagepropertiesTest qpackageproperties_test.cpp)
+target_link_libraries(QPackagepropertiesTest cpp-portage)
add_executable(QPortagesettingsTest qportagesettings_test.cpp)
-
-
-set(test_EXECS QtWrapperTest QPackagepropertiesTest QPortagesettingsTest)
-target_link_libraries(QtWrapperTest ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
-target_link_libraries(QPackagepropertiesTest ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
-target_link_libraries(QPortagesettingsTest ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
-
-install(TARGETS QtWrapperTest QPackagepropertiesTest QPortagesettingsTest DESTINATION lib)
-
-
-
-#include_directories(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR})
-#remove_definitions(-std=c99)
-
-#set(cpp-portage_SRCS qportagesettings.cpp)
-#set(cpp-portage_HDRS qportagesettings.h)
-
-#QT4_WRAP_CPP(cpp-portage_MOC_SRCS ${cpp-portage_HDRS})
-
-#add_library(cpp-portage qportagesettings.cpp ${cpp-portage_MOC_SRCS})
-
-#install(TARGETS cpp-portage DESTINATION lib)
-#install(FILES ${cpp-portage_HDRS} DESTINATION include/cpp-portage)
-
-#add_subdirectory(tests) \ No newline at end of file
+target_link_libraries(QPortagesettingsTest cpp-portage)
diff --git a/src/Qt/tests/qpackageproperties_test.cpp b/src/Qt/tests/qpackageproperties_test.cpp
index efde5e7..b7e99ac 100644
--- a/src/Qt/tests/qpackageproperties_test.cpp
+++ b/src/Qt/tests/qpackageproperties_test.cpp
@@ -1,14 +1,9 @@
-#include <QApplication>
+#include <QCoreApplication>
#include <QDebug>
+#include <QStringList>
#include "../qpackageproperties.h"
-#include "../qpackageproperties.cpp"
#include "../qlistconverter.h"
-#include "../qlistconverter.cpp"
-#include <QStringList>
-namespace CppPortage {
-class QPackageProperties;
-}
using namespace CppPortage;
@@ -27,6 +22,6 @@ void test() {
int main(int argc, char *argv[])
{
test();
- QApplication app(argc, argv);
+ QCoreApplication app(argc, argv);
return app.exec();
} \ No newline at end of file
diff --git a/src/Qt/tests/qportagesettings_test.cpp b/src/Qt/tests/qportagesettings_test.cpp
index ba24df7..da02903 100644
--- a/src/Qt/tests/qportagesettings_test.cpp
+++ b/src/Qt/tests/qportagesettings_test.cpp
@@ -1,13 +1,9 @@
-#include <QApplication>
+#include <QCoreApplication>
#include <QDebug>
#include <QStringList>
+
#include "../qportagesettings.h"
-#include "../qportagesettings.cpp"
#include "../qlistconverter.h"
-#include "../qlistconverter.cpp"
-namespace CppPortage {
- class QPortageSettings;
-}
using namespace CppPortage;
@@ -32,7 +28,7 @@ void test() {
int main(int argc, char *argv[])
{
test();
- QApplication app(argc, argv);
+ QCoreApplication app(argc, argv);
return app.exec();
}