Add qjson dependency and cleanup the cmake qt code.
authorZack Rusin <zack@kde.org>
Thu, 31 Mar 2011 00:14:01 +0000 (20:14 -0400)
committerZack Rusin <zack@kde.org>
Thu, 31 Mar 2011 02:48:42 +0000 (22:48 -0400)
CMakeLists.txt
gui/CMakeLists.txt
gui/mainwindow.cpp

index bd108fd..d189597 100644 (file)
@@ -16,7 +16,8 @@ set (CMAKE_USE_PYTHON_VERSION 2.6)
 
 find_package (PythonInterp REQUIRED)
 find_package (OpenGL REQUIRED)
-find_package (Qt4)
+find_package (Qt4 COMPONENTS QtCore QtGui QtWebKit)
+find_package (QJSON)
 
 if (NOT WIN32)
     # Always use the bundled zlib and libpng sources on Windows to make it easy
@@ -239,6 +240,8 @@ if (GLUT_INCLUDE_DIR)
     )
 endif (GLUT_INCLUDE_DIR)
 
-if (QT4_FOUND)
+if (QT4_FOUND AND QJSON_FOUND)
+    # Include the cmake file needed to use qt4
+    include( ${QT_USE_FILE} )
     add_subdirectory(gui)
-endif (QT4_FOUND)
+endif (QT4_FOUND AND QJSON_FOUND)
index 12ed63e..acecf9e 100644 (file)
@@ -17,13 +17,14 @@ set(qapitrace_UIS
 QT4_WRAP_UI(qapitrace_UIS_H ${qapitrace_UIS})
 
 #add_app_icon(qapitrace_SRCS ../icons/hi*-qapitrace.png)
+link_directories(${LINK_DIRECTORIES} ${QJSON_LIBRARY_DIRS})
+include_directories(${QT_INCLUDES} ${QJSON_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/..)
 
-include_directories(${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/..)
 add_definitions(-DBUILD_DIR="${CMAKE_CURRENT_BINARY_DIR}/..")
 
 add_executable(qapitrace ${qapitrace_SRCS} ${qapitrace_UIS_H})
 
-target_link_libraries(qapitrace trace ${QT_QTCORE_LIBRARIES} ${QT_QTGUI_LIBRARIES} ${QT_QTWEBKIT_LIBRARIES})
+target_link_libraries(qapitrace trace ${QJSON_LIBRARIES} ${QT_LIBRARIES} )
 
 ########### install files ###############
 
index 472ff27..592841c 100644 (file)
@@ -6,6 +6,8 @@
 #include "apitracemodel.h"
 #include "apitracefilter.h"
 
+#include <qjson/parser.h>
+
 #include <QAction>
 #include <QDebug>
 #include <QDir>