forked from raisimTech/raisimLib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
84 lines (70 loc) · 2.12 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
cmake_minimum_required(VERSION 3.10)
set(RAISIM_VERSION 1.0.0)
project(raisim VERSION ${RAISIM_VERSION} LANGUAGES CXX)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
# Include CMake helper modules
include(GNUInstallDirs)
# Build options
option(RAISIM_EXAMPLE "Build example applications." TRUE)
option(RAISIM_MATLAB "Build a matlab wrapper." FALSE)
option(RAISIM_PY "Build a python wrapper." FALSE)
option(RAISIM_DOC "Build a python wrapper." FALSE)
if (UNIX AND NOT APPLE AND NOT ANDROID AND NOT WEBGL AND NOT WIN32)
set(RAISIM_OS linux)
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/raisim/${RAISIM_OS})
elseif(APPLE)
set(RAISIM_OS mac)
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/raisim/${RAISIM_OS})
elseif(WIN32)
set(RAISIM_OS win32)
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/raisim/${RAISIM_OS}/mt_release)
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/raisim/${RAISIM_OS}/mt_debug)
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/thirdParty/Eigen3)
endif()
#==
# Package installation
#==
if(WIN32)
set(RAISIM_BIN_DIR ${RAISIM_OS}/mt_release)
install(
DIRECTORY
${CMAKE_CURRENT_LIST_DIR}/raisim/${RAISIM_BIN_DIR}/bin
DESTINATION
${CMAKE_INSTALL_PREFIX}
)
else()
set(RAISIM_BIN_DIR ${RAISIM_OS})
endif()
install(
DIRECTORY
${CMAKE_CURRENT_LIST_DIR}/raisim/${RAISIM_BIN_DIR}/include
DESTINATION
${CMAKE_INSTALL_PREFIX}
)
install(
DIRECTORY
"${CMAKE_CURRENT_LIST_DIR}/raisim/${RAISIM_BIN_DIR}/lib"
DESTINATION
${CMAKE_INSTALL_PREFIX}
)
install(FILES package.xml DESTINATION "${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}")
if(RAISIM_ALL)
set(RAISIM_EXAMPLE TRUE)
set(RAISIM_MATLAB TRUE)
set(RAISIM_PY TRUE)
set(RAISIM_DOC TRUE)
endif()
if(RAISIM_EXAMPLE)
add_subdirectory(examples)
endif()
if(RAISIM_MATLAB)
add_subdirectory(raisimMatlab)
endif()
if(RAISIM_PY)
add_subdirectory(thirdParty/pybind11)
add_subdirectory(raisimPy)
endif()
if(RAISIM_DOC)
add_subdirectory(docs)
endif()
# EOF