CMakeLists.txt 2.39 KB
Newer Older
Thomas Moulard's avatar
Thomas Moulard committed
1
# Copyright 2010, 2011, Florent Lamiraux, Thomas Moulard, JRL, CNRS/AIST
florent's avatar
florent committed
2
3
4
5
6

#
# Python
#

Joseph Mirabel's avatar
Joseph Mirabel committed
7
INCLUDE_DIRECTORIES(SYSTEM ${Boost_INCLUDE_DIRS})
Francois Keith's avatar
Francois Keith committed
8
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS} ${PYTHON_LIBRARY_DIRS})
florent's avatar
florent committed
9

10
11
12
13
14
15
16
#
#
#  Python interpreter
#
#
SET(LIBRARY_NAME ${PROJECT_NAME})
ADD_LIBRARY(${LIBRARY_NAME}
Guilhem Saurel's avatar
Guilhem Saurel committed
17
18
    SHARED
    interpreter.cc)
19

20
TARGET_LINK_LIBRARIES(${LIBRARY_NAME}
Guilhem Saurel's avatar
Guilhem Saurel committed
21
    ${PYTHON_LIBRARY})
Guilhem Saurel's avatar
Guilhem Saurel committed
22
TARGET_LINK_BOOST_PYTHON(${LIBRARY_NAME})
23

24
IF(UNIX)
Guilhem Saurel's avatar
Guilhem Saurel committed
25
26
    TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${Boost_LIBRARIES})
    TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${CMAKE_DL_LIBS})
27
ENDIF(UNIX)
28

29
30
31
32
SET_TARGET_PROPERTIES(${LIBRARY_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION})
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} dynamic-graph)

INSTALL(TARGETS ${LIBRARY_NAME}
Guilhem Saurel's avatar
Guilhem Saurel committed
33
    DESTINATION lib)
34

florent's avatar
florent committed
35
36
37
38
39
40
41
42
43
#
#
#  Python bindings
#
#

SET(PYTHON_MODULE wrap)

ADD_LIBRARY(${PYTHON_MODULE}
Guilhem Saurel's avatar
Guilhem Saurel committed
44
45
46
47
48
49
50
51
52
53
54
55
    MODULE
    convert-dg-to-py.cc
    debug-py.cc
    dynamic-graph-py.cc
    entity-py.cc
    exception-python.cc
    factory-py.cc
    pool-py.cc
    signal-base-py.cc
    signal-caster-py.cc
    signal-wrapper.cc
    )
florent's avatar
florent committed
56
57
58

# Remove prefix lib
SET_TARGET_PROPERTIES(${PYTHON_MODULE}
Guilhem Saurel's avatar
Guilhem Saurel committed
59
    PROPERTIES PREFIX "")
florent's avatar
florent committed
60

Francois Keith's avatar
Francois Keith committed
61
PKG_CONFIG_USE_DEPENDENCY(${PYTHON_MODULE} dynamic-graph)
62
#TARGET_LINK_LIBRARIES(${PYTHON_MODULE} ${PYTHON_LIBRARY})
florent's avatar
florent committed
63

64
CONFIG_FILES(link-to-python.hh)
Joseph Mirabel's avatar
Joseph Mirabel committed
65
66
INCLUDE_DIRECTORIES(SYSTEM ${PYTHON_INCLUDE_PATH})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
florent's avatar
florent committed
67
68
69
70
71

#
# Installation
#

Guilhem Saurel's avatar
Guilhem Saurel committed
72
INSTALL(TARGETS ${PYTHON_MODULE} DESTINATION ${PYTHON_SITELIB}/dynamic_graph)
florent's avatar
florent committed
73
74

SET (PYTHON_SOURCES
75
76
77
78
79
80
81
    __init__.py
    attrpath.py
    entity.py
    signal_base.py
    matlab.py
    script_shortcuts.py
    tools.py
Guilhem Saurel's avatar
Guilhem Saurel committed
82
    )
florent's avatar
florent committed
83
84

FOREACH (SOURCE ${PYTHON_SOURCES})
Guilhem Saurel's avatar
Guilhem Saurel committed
85
    PYTHON_INSTALL_ON_SITE(dynamic_graph ${SOURCE})
florent's avatar
florent committed
86
87
ENDFOREACH (SOURCE)

88
89
# --- ADD the wrap on the dg modules
# Tracer plugin
90
IF(WIN32)
Guilhem Saurel's avatar
Guilhem Saurel committed
91
    SET(TRACER_PLUGIN ${DYNAMIC_GRAPH_PLUGINDIR}/tracer${CMAKE_STATIC_LIBRARY_SUFFIX})
92
ELSE(WIN32)
Guilhem Saurel's avatar
Guilhem Saurel committed
93
    SET(TRACER_PLUGIN ${DYNAMIC_GRAPH_PLUGINDIR}/tracer${CMAKE_SHARED_LIBRARY_SUFFIX})
94
ENDIF(WIN32)
95
DYNAMIC_GRAPH_PYTHON_MODULE("tracer" ${TRACER_PLUGIN} tracer-wrap)
96
97

# TracerRealTime plugin
98
IF(WIN32)
Guilhem Saurel's avatar
Guilhem Saurel committed
99
    SET(TRACERREALTIME_PLUGIN ${DYNAMIC_GRAPH_PLUGINDIR}/tracer-real-time${CMAKE_STATIC_LIBRARY_SUFFIX})
100
ELSE(WIN32)
Guilhem Saurel's avatar
Guilhem Saurel committed
101
    SET(TRACERREALTIME_PLUGIN ${DYNAMIC_GRAPH_PLUGINDIR}/tracer-real-time${CMAKE_SHARED_LIBRARY_SUFFIX})
102
ENDIF(WIN32)
103
DYNAMIC_GRAPH_PYTHON_MODULE("tracer_real_time" ${TRACERREALTIME_PLUGIN} tracer_real_time-wrap)