-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCMakeLists.txt
107 lines (91 loc) · 3.88 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
PROJECT(dqrobotics-interface-vrep)
set (CMAKE_CXX_STANDARD 11)
if(APPLE)
INCLUDE_DIRECTORIES(
/usr/local/include/
/usr/local/include/eigen3
# Most recent versions of brew install here
/opt/homebrew/include
/opt/homebrew/include/eigen3)
ADD_COMPILE_OPTIONS(-Werror=return-type -Wall -Wextra -Wmissing-declarations -Wredundant-decls -Woverloaded-virtual)
# The library is installed here when using the regular cmake ., make, sudo make install
LINK_DIRECTORIES(
/usr/local/lib/)
endif()
if(WIN32)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
FIND_LIBRARY(DQROBOTICS_LIB NAMES dqrobotics)
ADD_DEFINITIONS(-D_USE_MATH_DEFINES)
FIND_PACKAGE(Eigen3 CONFIG REQUIRED)
INCLUDE_DIRECTORIES(${EIGEN3_INCLUDE_DIR})
endif()
add_definitions(-DNON_MATLAB_PARSING)
add_definitions(-DMAX_EXT_API_CONNECTIONS=255)
add_definitions(-DDO_NOT_USE_SHARED_MEMORY)
INCLUDE_DIRECTORIES(${PROJECT_NAME} include)
INCLUDE_DIRECTORIES(${PROJECT_NAME} coppeliarobotics/remoteApi)
INCLUDE_DIRECTORIES(${PROJECT_NAME} coppeliarobotics/include)
################################################################
# DEFINE AND INSTALL LIBRARY AND INCLUDE FOLDER
################################################################
ADD_LIBRARY(${PROJECT_NAME} SHARED
src/dqrobotics/interfaces/vrep/DQ_VrepInterface.cpp
src/dqrobotics/interfaces/vrep/DQ_VrepInterfaceMapElement.cpp
src/dqrobotics/interfaces/vrep/DQ_VrepRobot.cpp
src/dqrobotics/interfaces/vrep/DQ_SerialVrepRobot.cpp
src/dqrobotics/interfaces/vrep/robots/LBR4pVrepRobot.cpp
src/dqrobotics/interfaces/vrep/robots/YouBotVrepRobot.cpp
src/dqrobotics/interfaces/vrep/robots/FrankaEmikaPandaVrepRobot.cpp
coppeliarobotics/remoteApi/extApi.c
coppeliarobotics/remoteApi/extApiPlatform.c
)
SET_TARGET_PROPERTIES(${PROJECT_NAME}
PROPERTIES PUBLIC_HEADER
"include/dqrobotics/interfaces/vrep/DQ_VrepInterface.h"
)
INSTALL(TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION "lib"
PUBLIC_HEADER DESTINATION "include/dqrobotics/interfaces/vrep"
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
# This does not seem to be required on Ubuntu
if(APPLE)
TARGET_LINK_LIBRARIES(${PROJECT_NAME}
-ldqrobotics)
endif()
# The directive above does not seem to work on Windows
if(WIN32)
TARGET_LINK_LIBRARIES(${PROJECT_NAME}
${DQROBOTICS_LIB})
endif()
################################################################
# INSTALL HEADERS IN SUBFOLDERS
################################################################
# Other Headers
INSTALL(FILES
include/dqrobotics/interfaces/vrep/DQ_VrepRobot.h
include/dqrobotics/interfaces/vrep/DQ_SerialVrepRobot.h
include/dqrobotics/interfaces/vrep/DQ_VrepInterfaceMapElement.h
DESTINATION "include/dqrobotics/interfaces/vrep")
# Robots
INSTALL(FILES
include/dqrobotics/interfaces/vrep/robots/LBR4pVrepRobot.h
include/dqrobotics/interfaces/vrep/robots/YouBotVrepRobot.h
include/dqrobotics/interfaces/vrep/robots/FrankaEmikaPandaVrepRobot.h
DESTINATION "include/dqrobotics/interfaces/vrep/robots")
################################################################
# INSTALL SOURCE FILES (So that the debugger can find them)
################################################################
# base folder
INSTALL(FILES
src/dqrobotics/interfaces/vrep/DQ_VrepInterface.cpp
src/dqrobotics/interfaces/vrep/DQ_VrepInterfaceMapElement.cpp
src/dqrobotics/interfaces/vrep/DQ_VrepRobot.cpp
src/dqrobotics/interfaces/vrep/DQ_SerialVrepRobot.cpp
DESTINATION "src/dqrobotics/interfaces/vrep")
# robots folder
INSTALL(FILES
src/dqrobotics/interfaces/vrep/robots/LBR4pVrepRobot.cpp
src/dqrobotics/interfaces/vrep/robots/YouBotVrepRobot.cpp
src/dqrobotics/interfaces/vrep/robots/FrankaEmikaPandaVrepRobot.cpp
DESTINATION "src/dqrobotics/interfaces/vrep/robots")