Prepare the cmake infrastucture for eventually building
authorJörg Mayer <jmayer@loplof.de>
Thu, 2 Feb 2012 00:46:02 +0000 (00:46 -0000)
committerJörg Mayer <jmayer@loplof.de>
Thu, 2 Feb 2012 00:46:02 +0000 (00:46 -0000)
wireshark and qtshark simultanously.
The "only" missing thing for this is now ui/qt/CMakeLists.txt ;)

svn path=/trunk/; revision=40799

CMakeLists.txt
CMakeOptions.txt
ui/gtk/CMakeLists.txt

index 2c7bc929ed0c79776baf2b3424691b6d586d05b2..a0e770f24ce4031aa5b6963e585cb3741f474caa 100644 (file)
@@ -241,7 +241,7 @@ if(ENABLE_PCAP)
        set(PACKAGELIST ${PACKAGELIST} PCAP)
 endif()
 
-#Build the gui ?
+# Build the GTK-GUI?
 if(BUILD_wireshark)
        if(ENABLE_GTK3)
                set(PACKAGELIST ${PACKAGELIST} GTK3)
@@ -253,6 +253,12 @@ if(BUILD_wireshark)
        endif()
 endif()
 
+# Build the Qt GUI?
+if(BUILD_qtshark)
+       set(PACKAGELIST ${PACKAGELIST} QT)
+       # set(QT_OPTIONS 4.7.1 REQUIRED QtCore QtGui)
+endif()
+
 # SMI SNMP
 if(ENABLE_SMI)
        set(PACKAGELIST ${PACKAGELIST} SMI)
@@ -319,12 +325,17 @@ set(PROGLIST text2pcap mergecap capinfos editcap dumpcap)
 
 #Let's loop the package list
 foreach(PACKAGE ${PACKAGELIST})
+       if(${PACKAGE} EQUAL "QT")
+               set(PACKAGE_NAME "Qt4")
+       else()
+               set(PACKAGE_NAME ${PACKAGE})
+       endif()
        if(${PACKAGE}_OPTIONS)
-               find_package(${PACKAGE} ${${PACKAGE}_OPTIONS})
+               find_package(${PACKAGE_NAME} ${${PACKAGE}_OPTIONS})
        elseif(${PACKAGE}_REQUIRED)
-               find_package(${PACKAGE} REQUIRED)
+               find_package(${PACKAGE_NAME} REQUIRED)
        else()
-               find_package(${PACKAGE})
+               find_package(${PACKAGE_NAME})
        endif()
        message(${PACKAGE}_FOUND)
        if (${PACKAGE}_FOUND)
@@ -425,6 +436,11 @@ if(BUILD_wireshark AND GTK_FOUND)
        add_subdirectory( ui/gtk )
 endif()
 
+if(BUILD_qtshark AND QT_FOUND)
+       add_subdirectory( ui/qt )
+endif()
+
+
 # Basedir where to install guides
 set(DOC_DIR "$ENV{docdir}")
 message(STATUS "docdir: ${DOC_DIR}")
@@ -471,6 +487,7 @@ PRINT_DISABLED_FEATURES()
 
 link_directories(
        ${CMAKE_BINARY_DIR}/ui/gtk
+       ${CMAKE_BINARY_DIR}/ui/qt
        ${CMAKE_BINARY_DIR}/codecs
        ${CMAKE_BINARY_DIR}/epan
        ${CMAKE_BINARY_DIR}/wiretap
@@ -645,18 +662,7 @@ set(LIBEPAN_LIBS
                ${M_LIBRARIES}
 )
 
-if(BUILD_wireshark AND GTK_FOUND)
-       set(wireshark_LIBS
-               ui
-               ${GTK2_LIBRARIES}
-               ${GTK3_LIBRARIES}
-               ${GTHREAD2_LIBRARIES}
-               codecs
-               ${PORTAUDIO_LIBRARIES}
-               ${LIBEPAN_LIBS}
-               ${APPLE_CORE_SERVICES_LIBRARY}
-               ${APPLE_COCOA_LIBRARY}
-       )
+if( (BUILD_wireshark AND GTK_FOUND) OR (BUILD_qtshark AND QT_FOUND) )
        set(wireshark_FILES
                airpcap_loader.c
                alert_box.c
@@ -678,6 +684,22 @@ if(BUILD_wireshark AND GTK_FOUND)
                ${SHARK_COMMON_CAPTURE_SRC}
                ${WIRESHARK_COMMON_SRC}
        )
+endif()
+
+if(BUILD_wireshark AND GTK_FOUND)
+       set(wireshark_LIBS
+               gtkui
+               ${GTK2_LIBRARIES}
+               ${GTK3_LIBRARIES}
+               ${GTHREAD2_LIBRARIES}
+               codecs
+               ${PORTAUDIO_LIBRARIES}
+               ${LIBEPAN_LIBS}
+               ${APPLE_CORE_SERVICES_LIBRARY}
+               ${APPLE_COCOA_LIBRARY}
+       )
+       # qtshark and wireshark share wireshark_FILES
+
        add_executable(wireshark ${wireshark_FILES})
        add_dependencies(wireshark svnversion)
        set_target_properties(wireshark PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
@@ -685,6 +707,26 @@ if(BUILD_wireshark AND GTK_FOUND)
        install(TARGETS wireshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
 endif()
 
+if(BUILD_qtshark AND QT_FOUND)
+       set(qtshark_LIBS
+               qtui
+               ${QT_LIBRARIES}
+               ${GTHREAD2_LIBRARIES}
+               codecs
+               ${PORTAUDIO_LIBRARIES}
+               ${LIBEPAN_LIBS}
+               ${APPLE_CORE_SERVICES_LIBRARY}
+               ${APPLE_COCOA_LIBRARY}
+       )
+       # qtshark and wireshark share wireshark_FILES
+
+       add_executable(qtshark ${wireshark_FILES})
+       add_dependencies(qtshark svnversion)
+       set_target_properties(qtshark PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
+       target_link_libraries(qtshark ${qtshark_LIBS})
+       install(TARGETS qtshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+endif()
+
 register_tap_files(tshark-tap-register.c
        ${TSHARK_TAP_SRC}
 )
index 86076346d41e1226ce4d7dddc337cd44e551b2f7..21af1f2d936096e7880b97bcd6ab7c90b975d7d2 100644 (file)
@@ -2,7 +2,8 @@
 
 # $Id$
 
-option(BUILD_wireshark   "Build the GUI version of Wireshark" ON)
+option(BUILD_wireshark   "Build the GTK-GUI version of Wireshark" ON)
+option(BUILD_qtshark     "Build the QT-GUI version of Wireshark" OFF)
 option(BUILD_tshark      "Build tshark" ON)
 option(BUILD_rawshark    "Build rawshark" ON)
 option(BUILD_dumpcap     "Build dumpcap" ON)
index ceaa186b9d08ecc5476f1aeec144004a07790bf8..5ca9e7ffda09ead21912a7f9a1dea0a965c2ed46 100644 (file)
@@ -258,13 +258,13 @@ register_tap_files(wireshark-tap-register.c
        ${WIRESHARK_TAP_SRC}
 )
 
-add_library(ui STATIC
+add_library(gtkui STATIC
        ${WIRESHARK_GTK_SRC}
        ${WIRESHARK_TAP_SRC}
        ${PLATFORM_UI_SRC}
        wireshark-tap-register.c
 )
-set_target_properties(ui PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
+set_target_properties(gtkui PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
 
 install(
        DIRECTORY