CMakeLists.txt 2.13 KB
Newer Older
Guilhem Saurel's avatar
Guilhem Saurel committed
1
# Copyright 2010-2020, Florent Lamiraux, Thomas Moulard, Olivier Stasse, 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
31
32
33
IF (SUFFIX_SO_VERSION)
  SET_TARGET_PROPERTIES(${LIBRARY_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION})
ENDIF ()

34
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} dynamic-graph::dynamic-graph)
35

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

florent's avatar
florent committed
44
45
46
47
48
49
#
#
#  Python bindings
#
#

50
ADD_SUBDIRECTORY(dynamic_graph)
florent's avatar
florent committed
51
52

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

FOREACH (SOURCE ${PYTHON_SOURCES})
Guilhem Saurel's avatar
Guilhem Saurel committed
62
    PYTHON_INSTALL_ON_SITE(dynamic_graph ${SOURCE})
florent's avatar
florent committed
63
64
ENDFOREACH (SOURCE)

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

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