annotate extensions/dbg_interactive/CMakeLists.txt @ 1176:f0b328ea2fdb

Added initial support for hooks in the dbg_interactive extension
author Sebastien Decugis <sdecugis@freediameter.net>
date Mon, 03 Jun 2013 14:18:43 +0800
parents ae96ae28f3dd
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
833
2bf587a8f6bc Fix comments in CMakeLists -- Thomas Klausner <tk@giga.or.at>
Sebastien Decugis <sdecugis@freediameter.net>
parents: 658
diff changeset
1 # The dbg_interactive extension
609
2d15fd8ef5ba Very very early python interactive extension, using SWIG
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
2 PROJECT("Interactive debug facility based on SWIG" C)
2d15fd8ef5ba Very very early python interactive extension, using SWIG
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
3
2d15fd8ef5ba Very very early python interactive extension, using SWIG
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
4
2d15fd8ef5ba Very very early python interactive extension, using SWIG
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
5 # This module is using Python
882
ae96ae28f3dd Limit python version to avoid using python3 (not compatible)
Sebastien Decugis <sdecugis@freediameter.net>
parents: 833
diff changeset
6 SET(Python_ADDITIONAL_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
609
2d15fd8ef5ba Very very early python interactive extension, using SWIG
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
7 FIND_PACKAGE(PythonLibs)
2d15fd8ef5ba Very very early python interactive extension, using SWIG
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
8 INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
2d15fd8ef5ba Very very early python interactive extension, using SWIG
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
9
2d15fd8ef5ba Very very early python interactive extension, using SWIG
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
10 #####
2d15fd8ef5ba Very very early python interactive extension, using SWIG
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
11 # Wrapper to fD in python
2d15fd8ef5ba Very very early python interactive extension, using SWIG
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
12 FIND_PACKAGE(SWIG REQUIRED)
2d15fd8ef5ba Very very early python interactive extension, using SWIG
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
13 INCLUDE(${SWIG_USE_FILE})
624
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
14 SET(CMAKE_SWIG_FLAGS -castmode -threads)
609
2d15fd8ef5ba Very very early python interactive extension, using SWIG
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
15
618
1dbc4c5397d6 Attempting to improve python wrapper usability (work in progress)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 609
diff changeset
16 # Add the dependencies for re-swig-ing the file
624
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
17 SET(SWIG_MODULE_fDpy_EXTRA_DEPS
618
1dbc4c5397d6 Attempting to improve python wrapper usability (work in progress)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 609
diff changeset
18 ${CMAKE_BINARY_DIR}/include/freeDiameter/freeDiameter-host.h
658
f198d16fa7f4 Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 641
diff changeset
19 ${CMAKE_SOURCE_DIR}/include/freeDiameter/libfdcore.h
f198d16fa7f4 Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 641
diff changeset
20 ${CMAKE_SOURCE_DIR}/include/freeDiameter/libfdproto.h
637
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 625
diff changeset
21 lists.i
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 625
diff changeset
22 dictionary.i
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 625
diff changeset
23 sessions.i
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 625
diff changeset
24 routing.i
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 625
diff changeset
25 messages.i
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 625
diff changeset
26 dispatch.i
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 625
diff changeset
27 queues.i
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 625
diff changeset
28 peers.i
640
237cf6339546 dbg_interactive almost complete
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 637
diff changeset
29 events.i
237cf6339546 dbg_interactive almost complete
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 637
diff changeset
30 endpoints.i
641
69d3579f6c6c First version of dbg_interactive is complete
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 640
diff changeset
31 posix.i
1176
f0b328ea2fdb Added initial support for hooks in the dbg_interactive extension
Sebastien Decugis <sdecugis@freediameter.net>
parents: 882
diff changeset
32 hooks.i
637
22e8fac3b2d6 Split interface file in modules
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 625
diff changeset
33 )
624
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
34 SET_SOURCE_FILES_PROPERTIES(dbg_interactive.i PROPERTIES SWIG_MODULE_NAME fDpy)
618
1dbc4c5397d6 Attempting to improve python wrapper usability (work in progress)
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 609
diff changeset
35
624
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
36 # The following code is inspired from SWIG_ADD_MODULE, but we do only what we need
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
37 SWIG_MODULE_INITIALIZE(fDpy python)
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
38 SWIG_ADD_SOURCE_TO_MODULE(fDpy swig_generated_sources "dbg_interactive.i")
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
39
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
40 # In order to avoid shipping the python file that contains the shadow class definitions,
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
41 # we transform this file in a C-style string and compile it within our software.
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
42 # We use for this purpose xxd tool provided with vim package.
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
43 FIND_PROGRAM(XXD_EXECUTABLE xxd)
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
44 # To avoid the dependency, simply compile it if not provided
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
45 if (NOT XXD_EXECUTABLE)
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
46 SET_SOURCE_FILES_PROPERTIES(helper/xxd.c PROPERTIES COMPILE_DEFINITIONS UNIX)
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
47 ADD_EXECUTABLE(xxd helper/xxd.c)
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
48 SET(XXD_EXECUTABLE xxd)
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
49 endif (NOT XXD_EXECUTABLE)
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
50 # And now the magic command
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
51 ADD_CUSTOM_COMMAND(
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
52 OUTPUT "fDpy-inc.c"
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
53 COMMAND "${XXD_EXECUTABLE}"
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
54 ARGS "-i"
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
55 "fDpy.py"
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
56 "fDpy-inc.c"
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
57 MAIN_DEPENDENCY "${swig_extra_generated_files}"
625
2cd2cf7abe2a Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
58 COMMENT "Shadow definitions")
624
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
59
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
60 # Ensure that the generated source files are removed
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
61 GET_DIRECTORY_PROPERTY(swig_extra_clean_files ADDITIONAL_MAKE_CLEAN_FILES)
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
62 SET_DIRECTORY_PROPERTIES(PROPERTIES
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
63 ADDITIONAL_MAKE_CLEAN_FILES "${swig_extra_clean_files};${swig_generated_sources};fDpy-inc.c")
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
64
609
2d15fd8ef5ba Very very early python interactive extension, using SWIG
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
65
2d15fd8ef5ba Very very early python interactive extension, using SWIG
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
66 #####
2d15fd8ef5ba Very very early python interactive extension, using SWIG
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
67 # Extension that embeds the python interpreter
624
a5682d003ed9 Finally got the proxy aka shadow class to work
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 618
diff changeset
68 FD_ADD_EXTENSION(dbg_interactive dbg_interactive.c ${swig_generated_sources} fDpy-inc.c)
609
2d15fd8ef5ba Very very early python interactive extension, using SWIG
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
69 TARGET_LINK_LIBRARIES(dbg_interactive ${PYTHON_LIBRARIES})
2d15fd8ef5ba Very very early python interactive extension, using SWIG
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
70
625
2cd2cf7abe2a Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
71
2cd2cf7abe2a Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
72 ####
2cd2cf7abe2a Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
73 ## INSTALL section ##
2cd2cf7abe2a Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
74
2cd2cf7abe2a Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
75 INSTALL(TARGETS dbg_interactive
2cd2cf7abe2a Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
76 LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX}
2cd2cf7abe2a Improvements to usability, still work ongoing
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 624
diff changeset
77 COMPONENT freeDiameter-debug-tools)
"Welcome to our mercurial repository"