- Move setting _U_ into config.h, because

a) C++ has a standardized way of marking parameters as unused
  b) cmakes autoquoting magic failed when the compiler wasn't gcc
     but moc instead.
- qtshark: Don't try to compile the c source files inside ui/qt/
- qtshark: Only run moc on the files that need it.
- qtshark: It's too early to try any of the new qtshark files
  as clean.
- Make Qt detection actually work
- Add C++ to the list of languages for this project

svn path=/trunk/; revision=40807
This commit is contained in:
Jörg Mayer 2012-02-02 12:04:22 +00:00
parent 2d7a4646e2
commit 137f3fc455
3 changed files with 24 additions and 45 deletions

View File

@ -21,7 +21,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
project(Wireshark C)
project(Wireshark C CXX)
cmake_minimum_required(VERSION 2.6)
set(CMAKE_BACKWARDS_COMPATIBILITY 2.6)
@ -186,9 +186,9 @@ else()
endif()
if(CMAKE_COMPILER_IS_GNUCC)
add_definitions( -D_U_=__attribute__\(\(unused\)\) )
set (C_UNUSED "__attribute__((unused))" )
else()
add_definitions( -D_U_=\"\" )
set (C_UNUSED "" )
endif()
set(WIRESHARK_LD_FLAGS
@ -325,7 +325,7 @@ set(PROGLIST text2pcap mergecap capinfos editcap dumpcap)
#Let's loop the package list
foreach(PACKAGE ${PACKAGELIST})
if(${PACKAGE} EQUAL "QT")
if(${PACKAGE} STREQUAL "QT")
set(PACKAGE_NAME "Qt4")
else()
set(PACKAGE_NAME ${PACKAGE})
@ -383,6 +383,13 @@ endif()
if(HAVE_LIBZLIB)
set(HAVE_LIBZ 1)
endif()
# QT_LIBRARIES and QT_INCLUDES are not set above. They require extra magic:
if(QT_FOUND)
include(${QT_USE_FILE})
include_directories(${QT_INCLUDE_DIR})
message(STATUS "QT includes: ${QT_INCLUDE_DIR}")
message(STATUS "QT libs: ${QT_LIBRARIES}")
endif()
include(ConfigureChecks.cmake)

View File

@ -368,3 +368,10 @@
`char[]'. */
/* Note: not use in the code */
#cmakedefine YYTEXT_POINTER
/* _U_ isn't needed for C++, simply don't name the variable.
Also, running moc with -D_U_... breaks cmake's auto escaping magic. */
#ifndef __cplusplus
# define _U_ ${C_UNUSED}
#endif

View File

@ -21,43 +21,6 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
set(QTSHARK_C_SRC
../../airpcap_loader.c
../../alert_box.c
../../capture-pcap-util.c
../../capture.c
../../capture_ifinfo.c
../../capture_info.c
../../capture_opts.c
../../capture_sync.c
../../capture_ui_utils.c
../../cfile.c
../../clopts_common.c
../../color_filters.c
../../disabled_protos.c
../../file.c
../../fileset.c
../../filters.c
../../frame_data_sequence.c
../../g711.c
../../merge.c
../../packet-range.c
../../print.c
../../proto_hier_stats.c
../../ps.c
../../recent.c
../../summary.c
../../sync_pipe_write.c
../../tap-megaco-common.c
../../tap-rtp-common.c
../../tempfile.c
../../timestats.c
../../u3.c
../../util.c
../../version_info.c
)
# All .h files which inherit from QObject aka which use the Q_OBJECT macro
# need to go here.
set(QTSHARK_H_SRC
@ -79,13 +42,15 @@ set(QTSHARK_H_SRC
monospace_font.h
packet_list.h
packet_list_model.h
packet_list_record.h
progress_dialog.h
proto_tree.h
qt_ui_utils.h
recent_file_status.h
simple_dialog_qt.h
wireshark_application.h
# No Q_OBJECT:
# packet_list_record.h
# qt_ui_utils.h
)
set(QTSHARK_CPP_SRC
@ -118,7 +83,6 @@ set(QTSHARK_CPP_SRC
)
set(QTSHARK_SRC
${QTSHARK_C_SRC}
${QTSHARK_CPP_SRC}
)
@ -131,7 +95,8 @@ QT4_WRAP_UI(QTSHARK_UI_SRC ${QTSHARK_UI})
QT4_WRAP_CPP(QTSHARK_MOC_SRC ${QTSHARK_H_SRC})
set(CLEAN_FILES
${QTSHARK_SRC}
# It's too early to care about clean files
# ${QTSHARK_SRC}
)
if (WERROR)