CMakeLists.txt 1.96 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)
Guilhem Saurel's avatar
Guilhem Saurel committed
25
    TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${CMAKE_DL_LIBS})
26
ENDIF(UNIX)
27

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

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

florent's avatar
florent committed
39
40
41
42
43
44
#
#
#  Python bindings
#
#

45
ADD_SUBDIRECTORY(dynamic_graph)
florent's avatar
florent committed
46
47

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

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

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

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