From 857b128fe88fe0d078bf00ccfa794f826bc8d7fb Mon Sep 17 00:00:00 2001 From: Theofilos Intzoglou Date: Thu, 6 Oct 2011 16:35:36 +0300 Subject: Add option CppPortage in CMakeLists.txt to enable building of wrapper only when requested and create the appropriate CMakeLists.txt for the wrapper lib. --- src/CMakeLists.txt | 7 ++++++- src/Qt/CMakeLists.txt | 10 ++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 src/Qt/CMakeLists.txt 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}) -- cgit v1.2.3-65-gdbad