view extensions/dbg_interactive/CMakeLists.txt @ 1514:8912a0645645

Add 3GPP TS 29.234 V11.2.0 (2013-06) Add AVPs: - 3GPP-WLAN-APN-Id, OctetString, code 100, section 10.1.15 - Authentication-Method, Enumerated, code 300, section 10.1.5 - Authentication-Information-SIM, OctetString, code 301, section 10.1.6 - Authorization-Information-SIM, OctetString, code 302, section 10.1.7 - WLAN-User-Data, Grouped, code 303, section 10.1.8 - Charging-Data, Grouped, code 304, section 10.1.10 - WLAN-Access, Enumerated, code 305, section 10.1.11 - WLAN-3GPP-IP-Access, Enumerated, code 306, section 10.1.12 - APN-Authorized, Grouped, code 307, section 10.1.14 - APN-Barring-Type, Enumerated, code 309, section 10.1.16 - WLAN-Direct-IP-Access, Enumerated, code 310, section 10.1.17 - Session-Request-Type, Enumerated, code 311, section 10.1.23 - Routing-Policy, IPFilterRule, code 312, section 10.1.24 - Max-Requested-Bandwidth, OctetString, code 313, section 10.1.26 - Charging-Characteristics, Integer32, code 314, section 10.1.27 - Charging-Nodes, Grouped, code 315, section 10.1.28 - Primary-OCS-Charging-Function-Name, DiameterIdentity, code 316, section 10.1.29 - Secondary-OCS-Charging-Function-Name, DiameterIdentity, code 317, section 10.1.30 - Maximum-Number-Accesses, Unsigned32, code 319, section 10.1.38 APN-Id (308) OctetString only present from 3GPP TS 29.234 V6.2.0 (2005-03) to 3GPP TS 29.234 V6.4.0 (2005-09) before being deprecated in 3GPP TS 29.234 V6.5.0 (2005-12). (Not provided here.)
author Luke Mewburn <luke@mewburn.net>
date Wed, 08 Apr 2020 15:48:08 +1000
parents f0b328ea2fdb
children
line wrap: on
line source

# The dbg_interactive extension
PROJECT("Interactive debug facility based on SWIG" C)


# This module is using Python
SET(Python_ADDITIONAL_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
FIND_PACKAGE(PythonLibs)
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})

##### 
# Wrapper to fD in python
FIND_PACKAGE(SWIG REQUIRED)
INCLUDE(${SWIG_USE_FILE})
SET(CMAKE_SWIG_FLAGS -castmode -threads)

# Add the dependencies for re-swig-ing the file
SET(SWIG_MODULE_fDpy_EXTRA_DEPS 
	${CMAKE_BINARY_DIR}/include/freeDiameter/freeDiameter-host.h 
	${CMAKE_SOURCE_DIR}/include/freeDiameter/libfdcore.h 
	${CMAKE_SOURCE_DIR}/include/freeDiameter/libfdproto.h 
	lists.i
	dictionary.i
	sessions.i
	routing.i
	messages.i
	dispatch.i
	queues.i
	peers.i
	events.i
	endpoints.i
	posix.i
	hooks.i
	)
SET_SOURCE_FILES_PROPERTIES(dbg_interactive.i PROPERTIES SWIG_MODULE_NAME fDpy)

# The following code is inspired from SWIG_ADD_MODULE, but we do only what we need
SWIG_MODULE_INITIALIZE(fDpy python)
SWIG_ADD_SOURCE_TO_MODULE(fDpy swig_generated_sources "dbg_interactive.i")
	
# In order to avoid shipping the python file that contains the shadow class definitions, 
# we transform this file in a C-style string and compile it within our software.
# We use for this purpose xxd tool provided with vim package.
FIND_PROGRAM(XXD_EXECUTABLE xxd)
# To avoid the dependency, simply compile it if not provided
if (NOT XXD_EXECUTABLE) 
   SET_SOURCE_FILES_PROPERTIES(helper/xxd.c PROPERTIES COMPILE_DEFINITIONS UNIX)
   ADD_EXECUTABLE(xxd helper/xxd.c)
   SET(XXD_EXECUTABLE xxd)
endif (NOT XXD_EXECUTABLE) 
# And now the magic command
ADD_CUSTOM_COMMAND(
    OUTPUT "fDpy-inc.c"
    COMMAND "${XXD_EXECUTABLE}"
    ARGS "-i"
    "fDpy.py"
    "fDpy-inc.c"
    MAIN_DEPENDENCY "${swig_extra_generated_files}"
    COMMENT "Shadow definitions") 

# Ensure that the generated source files are removed
GET_DIRECTORY_PROPERTY(swig_extra_clean_files ADDITIONAL_MAKE_CLEAN_FILES)
SET_DIRECTORY_PROPERTIES(PROPERTIES
        ADDITIONAL_MAKE_CLEAN_FILES "${swig_extra_clean_files};${swig_generated_sources};fDpy-inc.c")


#####
# Extension that embeds the python interpreter
FD_ADD_EXTENSION(dbg_interactive dbg_interactive.c ${swig_generated_sources} fDpy-inc.c)
TARGET_LINK_LIBRARIES(dbg_interactive ${PYTHON_LIBRARIES})


####
## INSTALL section ##

INSTALL(TARGETS dbg_interactive
	LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX}
	COMPONENT freeDiameter-debug-tools)
"Welcome to our mercurial repository"