forked from agimus-project/pym3t
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
41 lines (34 loc) · 1.4 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.11)
project(pym3t LANGUAGES CXX)
option(USE_AZURE_KINECT "Use Azure Kinect" OFF)
option(USE_REALSENSE "Use RealSense D435" ON)
option(USE_GTEST "Use gtest" OFF)
cmake_policy(SET CMP0148 OLD) # required for current pybind11
# set(CMAKE_BUILD_TYPE "RELEASE") set(CMAKE_BUILD_TYPE "DEBUG")
include(FetchContent)
FetchContent_Declare(
pybind11
GIT_REPOSITORY "https://github.com/pybind/pybind11"
GIT_TAG "v2.11.1")
FetchContent_Declare(
m3t
GIT_REPOSITORY "https://github.com/DLR-RM/3DObjectTracking.git"
GIT_TAG "master"
SOURCE_SUBDIR "M3T" CMAKE_ARGS "-DUSE_AZURE_KINECT=${USE_AZURE_KINECT}"
"-DUSE_REALSENSE=${USE_REALSENSE}" "-DUSE_GTEST=${USE_GTEST}")
FetchContent_MakeAvailable(pybind11 m3t)
# Create library for the extensions to m3t
add_library(m3t_ext src/dummy_camera.cpp include/pym3t/dummy_camera.h)
target_compile_features(m3t_ext PUBLIC cxx_std_17)
target_include_directories(
m3t_ext
PUBLIC $<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${m3t_SOURCE_DIR}/include>)
target_link_libraries(m3t_ext PUBLIC m3t)
pybind11_add_module(_pym3t_mod MODULE src/pym3t.cpp)
target_link_libraries(_pym3t_mod PUBLIC m3t_ext)
target_include_directories(
_pym3t_mod PUBLIC $<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>)
install(TARGETS _pym3t_mod DESTINATION pym3t)