diff options
author | Jörg Mayer <jmayer@loplof.de> | 2009-09-02 16:33:01 +0000 |
---|---|---|
committer | Jörg Mayer <jmayer@loplof.de> | 2009-09-02 16:33:01 +0000 |
commit | d26cdc30ea07e2ada9ee319a1ac4abdae0830ea3 (patch) | |
tree | b428dcb68b9835ca071c0df8876c6d6e7a6dd034 /CMakeLists.txt | |
parent | 822d0a22428f55d59fee9281d934f3826735157d (diff) |
Beginnings of getting cmake to build stuff in epan.
It's only beginnings, so epan is commented out in
the subdirs statement.
This is more a synch to avoid duplicate work and creating
conflicting patches to the cmake stuff.
svn path=/trunk/; revision=29666
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 276 |
1 files changed, 145 insertions, 131 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b1b3c2c5e..2de0e59dbd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,12 +26,14 @@ project(wireshark C) cmake_minimum_required(VERSION 2.6) subdirs( - wiretap - wsutil +# epan + wiretap + wsutil ) #Where to find local cmake scripts set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules) +INCLUDE(UseLemon) # Under linux the release mode (CMAKE_BUILD_TYPE=release) defines NDEBUG @@ -44,17 +46,17 @@ set(BUILD_SHARED_LIBS ON) include(CMakeInstallDirs) include_directories( - ${CMAKE_BINARY_DIR} - ${CMAKE_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/wiretap - ${CMAKE_SOURCE_DIR}/wsutil + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR} +# ${CMAKE_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/wiretap + ${CMAKE_SOURCE_DIR}/wsutil ) #Where to put libraries if(NOT LIBRARY_OUTPUT_PATH) - set(LIBRARY_OUTPUT_PATH ${wireshark_BINARY_DIR}/lib CACHE INTERNAL - "Single output directory for building all libraries.") + set(LIBRARY_OUTPUT_PATH ${wireshark_BINARY_DIR}/lib CACHE INTERNAL + "Single output directory for building all libraries.") endif() option(BUILD_wireshark "Build the GUI version of Wireshark" ON) @@ -72,54 +74,54 @@ option(ENABLE_ADNS "Build with adns support" ON) option(ENABLE_EXTRA_GCC_CHECKS "Do additional -W checks in GCC" OFF) if(ENABLE_EXTRA_GCC_CHECKS) - set(WIRESHARK_EXTRA_GCC_FLAGS -Wcast-qual -Wcast-align -Wbad-function-cast - -pedantic -Wstrict-prototypes -Wmissing-declarations -Wwrite-strings) + set(WIRESHARK_EXTRA_GCC_FLAGS -Wcast-qual -Wcast-align -Wbad-function-cast + -pedantic -Wstrict-prototypes -Wmissing-declarations -Wwrite-strings) endif() if(CMAKE_COMPILER_IS_GNUCC) - add_definitions( - -DHAVE_CONFIG_H - -D_U_=__attribute__\(\(unused\)\) - -Wall -Wpointer-arith -W - ${WIRESHARK_EXTRA_GCC_FLAGS} - ) + add_definitions( + -DHAVE_CONFIG_H + -D_U_=__attribute__\(\(unused\)\) + -Wall -Wpointer-arith -W + ${WIRESHARK_EXTRA_GCC_FLAGS} + ) else() - add_definitions(-DHAVE_CONFIG_H -D_U_=\"\") + add_definitions(-DHAVE_CONFIG_H -D_U_=\"\") endif() #The minimum package list if(WIN32) - set(PACKAGELIST WSWIN32 LEX YACC Perl ${PACKAGELIST}) + set(PACKAGELIST WSWIN32 LEX YACC Perl ${PACKAGELIST}) else() - set(PACKAGELIST GLIB2 PCAP LEX YACC Perl ${PACKAGELIST}) + set(PACKAGELIST GLIB2 PCAP LEX YACC Perl ${PACKAGELIST}) endif() -#build the gui ? +#Build the gui ? if(BUILD_wireshark) - set(PACKAGELIST GTK2 ${PACKAGELIST}) + set(PACKAGELIST GTK2 ${PACKAGELIST}) endif() -#Gnu asynchronous dns +#Gnu asynchronous DNS if(ENABLE_ADNS) - set(PACKAGELIST ADNS ${PACKAGELIST}) - set(HAVE_GNU_ADNS 1) + set(PACKAGELIST ADNS ${PACKAGELIST}) + set(HAVE_GNU_ADNS 1) endif() set(PROGLIST text2pcap mergecap capinfos editcap dumpcap) #Let's loop the package list foreach(PACKAGE ${PACKAGELIST}) - find_package(${PACKAGE} REQUIRED) - message(${PACKAGE}_FOUND) - if (${PACKAGE}_FOUND) - set(HAVE_LIB${PACKAGE} "1") - include_directories(${${PACKAGE}_INCLUDE_DIRS}) - message(STATUS "${PACKAGE} include ${${PACKAGE}_INCLUDE_DIRS}") - foreach(PROG ${PROGLIST}) -# set(${PROG}_LIBS ${${PROG}_LIBS} ${${PACKAGE}_LIBRARIES}) - endforeach() - message(STATUS "${PACKAGE} lib ${${PACKAGE}_LIBRARIES}") - endif() + find_package(${PACKAGE} REQUIRED) + message(${PACKAGE}_FOUND) + if (${PACKAGE}_FOUND) + set(HAVE_LIB${PACKAGE} "1") + include_directories(${${PACKAGE}_INCLUDE_DIRS}) + message(STATUS "${PACKAGE} include ${${PACKAGE}_INCLUDE_DIRS}") + foreach(PROG ${PROGLIST}) +# set(${PROG}_LIBS ${${PROG}_LIBS} ${${PACKAGE}_LIBRARIES}) + endforeach() + message(STATUS "${PACKAGE} lib ${${PACKAGE}_LIBRARIES}") + endif() endforeach() #packaging @@ -148,50 +150,62 @@ set(DATAFILE_DIR "${CMAKE_INSTALL_PREFIX}/share/${CPACK_PACKAGE_NAME}") #Platform specific if(UNIX) - set(WS_VAR_IMPORT "extern") + set(WS_VAR_IMPORT "extern") endif() if(APPLE) #TODO verify that APPLE implies HAVE_OS_X_FRAMEWORKS - set(HAVE_OS_X_FRAMEWORKS 1) + set(HAVE_OS_X_FRAMEWORKS 1) endif() if(WIN32) - add_definitions(-DHAVE_WIN32_LIBWIRESHARK_LIB -D_NEED_VAR_IMPORT_) - set(WS_VAR_IMPORT "__declspec(dllimport) extern") + add_definitions(-DHAVE_WIN32_LIBWIRESHARK_LIB -D_NEED_VAR_IMPORT_) + set(WS_VAR_IMPORT "__declspec(dllimport) extern") - # Disable deprecation - if(MSVC80 OR MSVC90) - add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE) - endif() + # Disable deprecation + if(MSVC80 OR MSVC90) + add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE) + endif() endif() configure_file(${CMAKE_SOURCE_DIR}/cmakeconfig.h.in ${CMAKE_BINARY_DIR}/config.h) link_directories( - wiretap - wsutil + wiretap + wsutil + epan ) ADD_CUSTOM_COMMAND( - OUTPUT ${CMAKE_BINARY_DIR}/svnversion.h - COMMAND ${PERL} ${CMAKE_SOURCE_DIR}/make-version.pl - ARGS - ${CMAKE_SOURCE_DIR} + OUTPUT ${CMAKE_BINARY_DIR}/svnversion.h + COMMAND ${PERL} ${CMAKE_SOURCE_DIR}/make-version.pl + ARGS + ${CMAKE_SOURCE_DIR} ) SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/svnversion.h GENERATED) +# Create the necessary tools +set(lemon_FILES + tools/lemon/lemon.c +) +set(lemon_LIBS + # Do we need something here on any platform? +) +add_executable(lemon ${lemon_FILES}) +target_link_libraries(lemon ${lemon_LIBS}) +# but don't install them + if(UNIX) - set(PLATFORM_SRC - capture-pcap-util-unix.c - ) + set(PLATFORM_SRC + capture-pcap-util-unix.c + ) endif() if(WIN32) - set(PLATFORM_SRC - capture-wpcap.c capture_wpcap_packet.c - ) + set(PLATFORM_SRC + capture-wpcap.c capture_wpcap_packet.c + ) endif() if(BUILD_wireshark) @@ -215,91 +229,91 @@ if(BUILD_dftest) endif() if(BUILD_text2pcap) - set(text2pcap_LIBS - wiretap - wsutil - ${GLIB2_LIBRARIES} - ) - set(text2pcap_FILES - text2pcap.c - ) - add_lex_files(text2pcap_FILES - text2pcap-scanner.l - ) - add_executable(text2pcap ${text2pcap_FILES}) - target_link_libraries(text2pcap ${text2pcap_LIBS}) - install(TARGETS text2pcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + set(text2pcap_LIBS + wiretap + wsutil + ${GLIB2_LIBRARIES} + ) + set(text2pcap_FILES + text2pcap.c + ) + add_lex_files(text2pcap_FILES + text2pcap-scanner.l + ) + add_executable(text2pcap ${text2pcap_FILES}) + target_link_libraries(text2pcap ${text2pcap_LIBS}) + install(TARGETS text2pcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() if(BUILD_mergecap) - set(mergecap_LIBS - wiretap - wsutil - ${GLIB2_LIBRARIES} - ) - set(mergecap_FILES - mergecap.c - merge.c - svnversion.h - ) - add_executable(mergecap ${mergecap_FILES}) - target_link_libraries(mergecap ${mergecap_LIBS}) - install(TARGETS mergecap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + set(mergecap_LIBS + wiretap + wsutil + ${GLIB2_LIBRARIES} + ) + set(mergecap_FILES + mergecap.c + merge.c + svnversion.h + ) + add_executable(mergecap ${mergecap_FILES}) + target_link_libraries(mergecap ${mergecap_LIBS}) + install(TARGETS mergecap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() if(BUILD_capinfos) - set(capinfos_LIBS - wiretap - wsutil - ${GLIB2_LIBRARIES} - ) - set(capinfos_FILES - capinfos.c - ) - add_executable(capinfos ${capinfos_FILES}) - target_link_libraries(capinfos ${capinfos_LIBS}) - install(TARGETS capinfos RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + set(capinfos_LIBS + wiretap + wsutil + ${GLIB2_LIBRARIES} + ) + set(capinfos_FILES + capinfos.c + ) + add_executable(capinfos ${capinfos_FILES}) + target_link_libraries(capinfos ${capinfos_LIBS}) + install(TARGETS capinfos RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() if(BUILD_editcap) - set(editcap_LIBS - wiretap - wsutil - ${GLIB2_LIBRARIES} - ) - set(editcap_FILES - editcap.c - epan/crypt/crypt-md5.c - epan/nstime.c - ) - add_executable(editcap ${editcap_FILES}) - target_link_libraries(editcap ${editcap_LIBS}) - install(TARGETS editcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + set(editcap_LIBS + wiretap + wsutil + ${GLIB2_LIBRARIES} + ) + set(editcap_FILES + editcap.c + epan/crypt/crypt-md5.c + epan/nstime.c + ) + add_executable(editcap ${editcap_FILES}) + target_link_libraries(editcap ${editcap_LIBS}) + install(TARGETS editcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() if(BUILD_dumpcap) - set(dumpcap_LIBS - wiretap - wsutil - ${GLIB2_LIBRARIES} - ${PCAP_LIBRARIES} - ) - set(dumpcap_FILES - svnversion.h - capture_opts.c - capture-pcap-util.c - capture_stop_conditions.c - clopts_common.c - conditions.c - dumpcap.c - pcapio.c - ringbuffer.c - sync_pipe_write.c - tempfile.c - version_info.c - ${PLATFORM_SRC} - ) - add_executable(dumpcap ${dumpcap_FILES}) - target_link_libraries(dumpcap ${dumpcap_LIBS}) - install(TARGETS dumpcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + set(dumpcap_LIBS + wiretap + wsutil + ${GLIB2_LIBRARIES} + ${PCAP_LIBRARIES} + ) + set(dumpcap_FILES + svnversion.h + capture_opts.c + capture-pcap-util.c + capture_stop_conditions.c + clopts_common.c + conditions.c + dumpcap.c + pcapio.c + ringbuffer.c + sync_pipe_write.c + tempfile.c + version_info.c + ${PLATFORM_SRC} + ) + add_executable(dumpcap ${dumpcap_FILES}) + target_link_libraries(dumpcap ${dumpcap_LIBS}) + install(TARGETS dumpcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() |