CMakeLists.txt 3.1 KB
Newer Older
Thomas Moulard's avatar
Thomas Moulard committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Copyright 2010, 2011, Florent Lamiraux, Thomas Moulard, JRL, CNRS/AIST
#
# This file is part of dynamic-graph-python.
# dynamic-graph-python is free software: you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# dynamic-graph-python is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Lesser Public License for more details.  You should have
# received a copy of the GNU Lesser General Public License along with
# dynamic-graph-python. If not, see <http://www.gnu.org/licenses/>.
florent's avatar
florent committed
15
16
17
18
19

#
# Python
#

Joseph Mirabel's avatar
Joseph Mirabel committed
20
INCLUDE_DIRECTORIES(SYSTEM ${Boost_INCLUDE_DIRS})
Francois Keith's avatar
Francois Keith committed
21
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS} ${PYTHON_LIBRARY_DIRS})
florent's avatar
florent committed
22

23
24
25
26
27
28
29
30
31
32
#
#
#  Python interpreter
#
#
SET(LIBRARY_NAME ${PROJECT_NAME})
ADD_LIBRARY(${LIBRARY_NAME}
  SHARED
  interpreter.cc)

33
34
TARGET_LINK_LIBRARIES(${LIBRARY_NAME}
  ${PYTHON_LIBRARY})
Guilhem Saurel's avatar
Guilhem Saurel committed
35
TARGET_LINK_BOOST_PYTHON(${LIBRARY_NAME})
36

37
38
IF(UNIX)
  TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${Boost_LIBRARIES})
39
  TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${CMAKE_DL_LIBS})
40
ENDIF(UNIX)
41

42
43
44
45
SET_TARGET_PROPERTIES(${LIBRARY_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION})
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} dynamic-graph)

INSTALL(TARGETS ${LIBRARY_NAME}
46
  DESTINATION lib)
47

florent's avatar
florent committed
48
49
50
51
52
53
54
55
56
57
#
#
#  Python bindings
#
#

SET(PYTHON_MODULE wrap)

ADD_LIBRARY(${PYTHON_MODULE}
	MODULE
Nicolas Mansard's avatar
IVIGIT.    
Nicolas Mansard committed
58
	exception-python.cc
59
	convert-dg-to-py.cc
60
61
62
	dynamic-graph-py.cc
	signal-base-py.cc
	entity-py.cc
florent's avatar
florent committed
63
	factory-py.cc
64
	pool-py.cc
65
	signal-caster-py.cc
66
	signal-wrapper.cc
67
)
florent's avatar
florent committed
68
69
70
71
72

# Remove prefix lib
SET_TARGET_PROPERTIES(${PYTHON_MODULE}
	PROPERTIES PREFIX "")

Francois Keith's avatar
Francois Keith committed
73
PKG_CONFIG_USE_DEPENDENCY(${PYTHON_MODULE} dynamic-graph)
74
#TARGET_LINK_LIBRARIES(${PYTHON_MODULE} ${PYTHON_LIBRARY})
florent's avatar
florent committed
75

76
CONFIG_FILES(link-to-python.hh)
Joseph Mirabel's avatar
Joseph Mirabel committed
77
78
INCLUDE_DIRECTORIES(SYSTEM ${PYTHON_INCLUDE_PATH})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
florent's avatar
florent committed
79
80
81
82
83
84
85
86
87
88
89
90

#
# Installation
#

SET(PYTHON_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${PYTHON_SITELIB}/dynamic_graph)

INSTALL(TARGETS ${PYTHON_MODULE}
	       DESTINATION
	       ${PYTHON_INSTALL_DIR})

SET (PYTHON_SOURCES
91
92
93
94
95
96
97
    __init__.py
    attrpath.py
    entity.py
    signal_base.py
    matlab.py
    script_shortcuts.py
    tools.py
98
)
florent's avatar
florent committed
99
100

FOREACH (SOURCE ${PYTHON_SOURCES})
101
  PYTHON_INSTALL_ON_SITE(dynamic_graph ${SOURCE} )
florent's avatar
florent committed
102
103
ENDFOREACH (SOURCE)

104
105
# --- ADD the wrap on the dg modules
# Tracer plugin
106
IF(WIN32)
107
SET(TRACER_PLUGIN ${DYNAMIC_GRAPH_PLUGINDIR}/tracer${CMAKE_STATIC_LIBRARY_SUFFIX})
108
ELSE(WIN32)
109
SET(TRACER_PLUGIN ${DYNAMIC_GRAPH_PLUGINDIR}/tracer${CMAKE_SHARED_LIBRARY_SUFFIX})
110
ENDIF(WIN32)
111
DYNAMIC_GRAPH_PYTHON_MODULE("tracer" ${TRACER_PLUGIN} tracer-wrap)
112
113

# TracerRealTime plugin
114
IF(WIN32)
115
SET(TRACERREALTIME_PLUGIN ${DYNAMIC_GRAPH_PLUGINDIR}/tracer-real-time${CMAKE_STATIC_LIBRARY_SUFFIX})
116
ELSE(WIN32)
117
SET(TRACERREALTIME_PLUGIN ${DYNAMIC_GRAPH_PLUGINDIR}/tracer-real-time${CMAKE_SHARED_LIBRARY_SUFFIX})
118
ENDIF(WIN32)
119
DYNAMIC_GRAPH_PYTHON_MODULE("tracer_real_time" ${TRACERREALTIME_PLUGIN} tracer_real_time-wrap)
120
121