CMakeLists.txt 2.08 KB
Newer Older
Guilhem Saurel's avatar
Guilhem Saurel committed
1
# Copyright 2010 - 2019, Florent Lamiraux, Thomas Moulard, Guilhem Saurel, JRL, CNRS/AIST, LAAS-CNRS
florent's avatar
florent committed
2

3
4
5
6
7
#
#
#  Python interpreter
#
#
8

9
SET(LIBRARY_NAME ${PROJECT_NAME})
10
ADD_LIBRARY(${LIBRARY_NAME} SHARED interpreter.cc dynamic_graph/python-compat.cc)
11

12
13
14
15
16
17
TARGET_INCLUDE_DIRECTORIES(${LIBRARY_NAME}
  PUBLIC
  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
  $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../include>
  $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/>
Olivier Stasse's avatar
Olivier Stasse committed
18
  INTERFACE
19
20
21
  $<INSTALL_INTERFACE:include>
)

22
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${PYTHON_LIBRARY})
23

24
IF(UNIX)
25
26
27
  TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${Boost_LIBRARIES})
  TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${Boost_PYTHON_LIBRARIES})
  TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${CMAKE_DL_LIBS})
28
ENDIF(UNIX)
29

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

33
34
INSTALL(TARGETS ${LIBRARY_NAME}
  EXPORT ${TARGETS_EXPORT_NAME}
Olivier Stasse's avatar
Olivier Stasse committed
35
36
37
38
39
  PUBLIC_HEADER
  INCLUDES DESTINATION include
  LIBRARY DESTINATION lib
  ARCHIVE DESTINATION lib
  )
40

florent's avatar
florent committed
41
42
43
44
45
46
#
#
#  Python bindings
#
#

47
ADD_SUBDIRECTORY(dynamic_graph)
florent's avatar
florent committed
48
49

SET (PYTHON_SOURCES
50
51
52
53
54
55
    __init__.py
    attrpath.py
    entity.py
    signal_base.py
    script_shortcuts.py
    tools.py
Guilhem Saurel's avatar
Guilhem Saurel committed
56
    )
florent's avatar
florent committed
57
58

FOREACH (SOURCE ${PYTHON_SOURCES})
Guilhem Saurel's avatar
Guilhem Saurel committed
59
    PYTHON_INSTALL_ON_SITE(dynamic_graph ${SOURCE})
florent's avatar
florent committed
60
61
ENDFOREACH (SOURCE)

62
63
# --- ADD the wrap on the dg modules
# Tracer plugin
64
IF(WIN32)
Guilhem Saurel's avatar
Guilhem Saurel committed
65
    SET(TRACER_PLUGIN ${DYNAMIC_GRAPH_PLUGINDIR}/tracer${CMAKE_STATIC_LIBRARY_SUFFIX})
66
ELSE(WIN32)
Guilhem Saurel's avatar
Guilhem Saurel committed
67
    SET(TRACER_PLUGIN ${DYNAMIC_GRAPH_PLUGINDIR}/tracer${CMAKE_SHARED_LIBRARY_SUFFIX})
68
ENDIF(WIN32)
69
DYNAMIC_GRAPH_PYTHON_MODULE("tracer" ${TRACER_PLUGIN} tracer-wrap)
70
71

# TracerRealTime plugin
72
IF(WIN32)
Guilhem Saurel's avatar
Guilhem Saurel committed
73
    SET(TRACERREALTIME_PLUGIN ${DYNAMIC_GRAPH_PLUGINDIR}/tracer-real-time${CMAKE_STATIC_LIBRARY_SUFFIX})
74
ELSE(WIN32)
Guilhem Saurel's avatar
Guilhem Saurel committed
75
    SET(TRACERREALTIME_PLUGIN ${DYNAMIC_GRAPH_PLUGINDIR}/tracer-real-time${CMAKE_SHARED_LIBRARY_SUFFIX})
76
ENDIF(WIN32)
77
DYNAMIC_GRAPH_PYTHON_MODULE("tracer_real_time" ${TRACERREALTIME_PLUGIN} tracer_real_time-wrap)