Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Copyright 2010, François Bleibel, Olivier Stasse, JRL, CNRS/AIST,
# Florent Lamiraux (CNRS/LAAS)
#
# This file is part of sot-dyninv.
# sot-dyninv 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.
#
# sot-dyninv 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
# sot-dyninv. If not, see <http://www.gnu.org/licenses/>.
INCLUDE(../cmake/python.cmake)
IF(CMAKE_BUILD_TYPE STREQUAL "DEBUG")
ADD_DEFINITIONS(-DDEBUG=2)
ENDIF(CMAKE_BUILD_TYPE STREQUAL "DEBUG")
FOREACH(lib ${libs})
ADD_LIBRARY(${lib} SHARED ${lib}.cpp)
SET_TARGET_PROPERTIES(${lib} PROPERTIES
PREFIX ""
SOVERSION ${PROJECT_VERSION})
IF(${lib}_plugins_dependencies)
ADD_DEPENDENCIES(${lib} "${${lib}_plugins_dependencies}")
TARGET_LINK_LIBRARIES(${lib} "${${lib}_plugins_dependencies}")
ENDIF(${lib}_plugins_dependencies)
PKG_CONFIG_USE_DEPENDENCY(${lib} sot-core)
PKG_CONFIG_USE_DEPENDENCY(${lib} dynamic-graph)
INSTALL(TARGETS ${lib} DESTINATION lib/plugin)
# build python submodule
STRING(REPLACE - _ PYTHON_LIBRARY_NAME ${lib})
ADD_DEPENDENCIES(${lib} MKDIR_${PYTHON_LIBRARY_NAME})
ADD_CUSTOM_TARGET(MKDIR_${PYTHON_LIBRARY_NAME}
mkdir -p dynamic_graph/sot/dyninv/${PYTHON_LIBRARY_NAME}
)
DYNAMIC_GRAPH_PYTHON_MODULE("sot/dyninv/${PYTHON_LIBRARY_NAME}"
${lib}
sot/dyninv/${PYTHON_LIBRARY_NAME}/wrap
)
ENDFOREACH(lib)
EXEC_PROGRAM(${PYTHON_EXECUTABLE} ARGS "-c \"from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='')\""
OUTPUT_VARIABLE PYTHON_SITELIB
)
# Install empty __init__.py files in intermediate directories.
INSTALL(FILES
${CMAKE_CURRENT_SOURCE_DIR}/dynamic_graph/sot/dyninv/__init__.py
DESTINATION ${PYTHON_SITELIB}/dynamic_graph/sot/dyninv
)