File: CMakeLists.txt

package info (click to toggle)
orocos-kdl 1.4.0-7
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 1,840 kB
  • sloc: cpp: 14,478; python: 380; xml: 87; makefile: 69; sh: 20
file content (27 lines) | stat: -rw-r--r-- 1,350 bytes parent folder | download
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
cmake_minimum_required(VERSION 2.4.6)

project(python_orocos_kdl)

execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${PROJECT_SOURCE_DIR}/../orocos_kdl/src ${PROJECT_BINARY_DIR}/../orocos_kdl/src/kdl)
include_directories(${PROJECT_BINARY_DIR}/../orocos_kdl/src)
include(${PROJECT_BINARY_DIR}/../orocos_kdl/orocos_kdl-config.cmake)
include_directories(${orocos_kdl_INCLUDE_DIRS})
link_directories(${orocos_kdl_LIBRARY_DIRS})

SET(PYTHON_VERSION 3 CACHE STRING "Python Version")
find_package(PythonInterp ${PYTHON_VERSION} REQUIRED)
find_package(PythonLibs ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} REQUIRED)
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(plat_specific=True, prefix=''))" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
find_package(SIP REQUIRED)
include(SIPMacros)

include_directories(${SIP_INCLUDE_DIR} ${PYTHON_INCLUDE_DIRS})

file(GLOB SIP_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.sip")
set(SIP_INCLUDES ${SIP_FILES})
set(SIP_EXTRA_OPTIONS "-o")
set(PYTHON_SITE_PACKAGES_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${PYTHON_SITE_PACKAGES})
add_sip_python_module(PyKDL PyKDL/PyKDL.sip ${orocos_kdl_LIBRARIES})

install(FILES package.xml DESTINATION share/python_orocos_kdl)