diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2016-02-22 06:21:53 +0000 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2016-03-01 19:23:39 +0000 |
commit | 6b54fbf3bfb7a3b0519637d01fa36bba8cec9c98 (patch) | |
tree | eb9ce7199c857fe314da04cabd448e9381e451ac /epan/wslua | |
parent | 5da2b437035dbd478293caa1c9242fe2e37924e6 (diff) |
CMake: Add more structure to libwireshark build
Smaller epan/CMakeLists.txt is easier to work with and this structure
is well suited to CMake. It should make it easier to manage and configure
each epan module differently if necessary.
Change-Id: Ia649db3b7dcd405aa43dbdba3288699d5e375229
Reviewed-on: https://code.wireshark.org/review/14068
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'epan/wslua')
-rw-r--r-- | epan/wslua/CMakeLists.txt | 130 | ||||
-rw-r--r-- | epan/wslua/wslua.h | 2 |
2 files changed, 82 insertions, 50 deletions
diff --git a/epan/wslua/CMakeLists.txt b/epan/wslua/CMakeLists.txt index 6541df806e..7b3ec346db 100644 --- a/epan/wslua/CMakeLists.txt +++ b/epan/wslua/CMakeLists.txt @@ -19,6 +19,11 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} +) + set(WSLUA_MODULES ${CMAKE_CURRENT_SOURCE_DIR}/lrexlib.c ${CMAKE_CURRENT_SOURCE_DIR}/lrexlib_glib.c @@ -51,69 +56,73 @@ set(WSLUA_MODULES ${CMAKE_CURRENT_SOURCE_DIR}/wslua_tvb.c ${CMAKE_CURRENT_SOURCE_DIR}/wslua_util.c ) -set (WSLUA_MODULES ${WSLUA_MODULES} PARENT_SCOPE) set(WSLUA_FILES ${WSLUA_MODULES} ${CMAKE_CURRENT_BINARY_DIR}/taps_wslua.c ${CMAKE_CURRENT_BINARY_DIR}/register_wslua.c ${CMAKE_CURRENT_SOURCE_DIR}/init_wslua.c - PARENT_SCOPE ) +source_group(wslua FILES ${WSLUA_FILES}) + +if(WERROR_COMMON_FLAGS) + set_source_files_properties( + ${WSLUA_FILES} + PROPERTIES + COMPILE_FLAGS ${WERROR_COMMON_FLAGS} + ) +endif() # make-taps.pl depends on the current working directory # to find the dissector files (contents of taps file # depend on this actually, so just changing the paths # in these lists won't help). -macro(WSLUA_GENERATE_TAP_SRC) - # Used with untypical CWD - set(WSLUA_TAPS_USED - ${CMAKE_SOURCE_DIR}/epan/dissectors/packet-http.h - ${CMAKE_SOURCE_DIR}/epan/dissectors/packet-ip.h - ${CMAKE_SOURCE_DIR}/epan/dissectors/packet-udp.h - ${CMAKE_SOURCE_DIR}/epan/dissectors/packet-h225.h - ${CMAKE_SOURCE_DIR}/epan/dissectors/packet-ieee80211.h - ) +# Used with untypical CWD +set(WSLUA_TAPS_USED + ${CMAKE_SOURCE_DIR}/epan/dissectors/packet-http.h + ${CMAKE_SOURCE_DIR}/epan/dissectors/packet-ip.h + ${CMAKE_SOURCE_DIR}/epan/dissectors/packet-udp.h + ${CMAKE_SOURCE_DIR}/epan/dissectors/packet-h225.h + ${CMAKE_SOURCE_DIR}/epan/dissectors/packet-ieee80211.h +) - add_custom_command( - OUTPUT - ${CMAKE_BINARY_DIR}/epan/wslua/taps_wslua.c - ${CMAKE_BINARY_DIR}/epan/wslua/taps.txt - COMMAND - ${PERL_EXECUTABLE} - ${CMAKE_SOURCE_DIR}/epan/wslua/make-taps.pl - ${CMAKE_SOURCE_DIR}/epan/wslua/taps - ${CMAKE_BINARY_DIR}/epan/wslua/taps_wslua.c - ${CMAKE_BINARY_DIR}/epan/wslua/taps.txt - ${CMAKE_SOURCE_DIR}/epan/wslua - WORKING_DIRECTORY - ${CMAKE_SOURCE_DIR}/epan/wslua - DEPENDS - ${CMAKE_SOURCE_DIR}/epan/wslua/taps - ${CMAKE_SOURCE_DIR}/epan/wslua/make-taps.pl - # Only here to add dependencies for the taps "source"files - ${WSLUA_TAPS_USED} - ) -endmacro() - -macro(WSLUA_GENERATE_REG_SRC) - add_custom_command( - OUTPUT - ${CMAKE_BINARY_DIR}/epan/wslua/declare_wslua.h - ${CMAKE_BINARY_DIR}/epan/wslua/register_wslua.c - COMMAND - ${PERL_EXECUTABLE} - ${CMAKE_SOURCE_DIR}/epan/wslua/make-reg.pl - ${WSLUA_MODULES} - WORKING_DIRECTORY - ${CMAKE_BINARY_DIR}/epan/wslua - DEPENDS - ${CMAKE_SOURCE_DIR}/epan/wslua/make-reg.pl - ${WSLUA_MODULES} - # ${CMAKE_CURRENT_BINARY_DIR}/taps_wslua.c - ) -endmacro() +add_custom_command( + OUTPUT + ${CMAKE_BINARY_DIR}/epan/wslua/taps_wslua.c + ${CMAKE_BINARY_DIR}/epan/wslua/taps.txt + COMMAND + ${PERL_EXECUTABLE} + ${CMAKE_SOURCE_DIR}/epan/wslua/make-taps.pl + ${CMAKE_SOURCE_DIR}/epan/wslua/taps + ${CMAKE_BINARY_DIR}/epan/wslua/taps_wslua.c + ${CMAKE_BINARY_DIR}/epan/wslua/taps.txt + ${CMAKE_SOURCE_DIR}/epan/wslua + WORKING_DIRECTORY + ${CMAKE_SOURCE_DIR}/epan/wslua + DEPENDS + ${CMAKE_SOURCE_DIR}/epan/wslua/taps + ${CMAKE_SOURCE_DIR}/epan/wslua/make-taps.pl + # Only here to add dependencies for the taps "source"files + ${WSLUA_TAPS_USED} +) + + +add_custom_command( + OUTPUT + ${CMAKE_BINARY_DIR}/epan/wslua/declare_wslua.h + ${CMAKE_BINARY_DIR}/epan/wslua/register_wslua.c + COMMAND + ${PERL_EXECUTABLE} + ${CMAKE_SOURCE_DIR}/epan/wslua/make-reg.pl + ${WSLUA_MODULES} + WORKING_DIRECTORY + ${CMAKE_BINARY_DIR}/epan/wslua + DEPENDS + ${CMAKE_SOURCE_DIR}/epan/wslua/make-reg.pl + ${WSLUA_MODULES} + # ${CMAKE_CURRENT_BINARY_DIR}/taps_wslua.c +) add_custom_command( OUTPUT init.lua @@ -136,6 +145,7 @@ add_custom_target( DEPENDS init.lua ) + set_target_properties(wsluaauxiliary PROPERTIES FOLDER "Auxiliary") install( @@ -146,3 +156,25 @@ install( DESTINATION ${CMAKE_INSTALL_DATADIR}/${CPACK_PACKAGE_NAME} ) + +add_library(wslua OBJECT + ${WSLUA_FILES} +) + +set_target_properties(wslua PROPERTIES + FOLDER "Libs/epan/wslua" + COMPILE_DEFINITIONS "WS_BUILD_DLL" +) + +# +# Editor modelines - http://www.wireshark.org/tools/modelines.html +# +# Local variables: +# c-basic-offset: 8 +# tab-width: 8 +# indent-tabs-mode: t +# End: +# +# vi: set shiftwidth=8 tabstop=8 noexpandtab: +# :indentSize=8:tabSize=8:noTabs=false: +# diff --git a/epan/wslua/wslua.h b/epan/wslua/wslua.h index 5239f21fe7..05c1fa3884 100644 --- a/epan/wslua/wslua.h +++ b/epan/wslua/wslua.h @@ -57,7 +57,7 @@ #include <epan/epan.h> #include <epan/expert.h> -#include "declare_wslua.h" +#include <epan/wslua/declare_wslua.h> /** @file * @ingroup wslua_group |