aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheofilos Intzoglou <int.teo@gmail.com>2011-10-06 16:35:36 +0300
committerTheofilos Intzoglou <int.teo@gmail.com>2011-10-06 16:35:36 +0300
commit857b128fe88fe0d078bf00ccfa794f826bc8d7fb (patch)
tree2f7ad2b2067b33fddd6b04ae7312f1883a3e86ed
parentA Qt dir had been added and the class PortageSettings (diff)
downloadc-portage-857b128fe88fe0d078bf00ccfa794f826bc8d7fb.tar.gz
c-portage-857b128fe88fe0d078bf00ccfa794f826bc8d7fb.tar.bz2
c-portage-857b128fe88fe0d078bf00ccfa794f826bc8d7fb.zip
Add option CppPortage in CMakeLists.txt to enable building of
wrapper only when requested and create the appropriate CMakeLists.txt for the wrapper lib.
-rw-r--r--src/CMakeLists.txt7
-rw-r--r--src/Qt/CMakeLists.txt10
2 files changed, 16 insertions, 1 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7a39eea..8551779 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -3,4 +3,9 @@ find_package(PythonLibs REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})
add_definitions(-std=c99)
add_library(c-portage dataconnect.c dict.c flag.c interpreter.c packageproperties.c portagesettings.c stringlist.c tester.c)
-target_link_libraries(${c-portage} stdlib.h types.h string.h stdio.h) \ No newline at end of file
+
+option(CppPortage "Enable c++ wrapper for c-portage (uses Qt4)")
+
+if (CppPortage)
+ add_subdirectory(Qt)
+endif(CppPortage) \ No newline at end of file
diff --git a/src/Qt/CMakeLists.txt b/src/Qt/CMakeLists.txt
new file mode 100644
index 0000000..2b11759
--- /dev/null
+++ b/src/Qt/CMakeLists.txt
@@ -0,0 +1,10 @@
+find_package(Qt4 REQUIRED)
+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})