-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
52 lines (42 loc) · 1.9 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
cmake_minimum_required(VERSION 3.5)
project(pepper_meshes)
find_package(ament_cmake REQUIRED)
# When getting a new binay, the MD5 might change, and the folder hierarchy too
# read comments below to adapt
set(TMP_DIR ${CMAKE_CURRENT_BINARY_DIR})
set(INSTALLER_PATH ${TMP_DIR}/installer.run)
if(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "$i.86$")
message(STATUS "Downloading 32 bit installer")
set(INSTALLER_URL "https://github.com/ros-naoqi/pepper_meshes_installer/raw/master/peppermeshes-0.2.0-linux-installer.run")
set(INSTALLER_MD5 9e78f24b52838e704210881f92c0983d)
elseif(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64")
message(STATUS "Downloading 64 bit installer")
set(INSTALLER_URL "https://github.com/ros-naoqi/pepper_meshes_installer/raw/master/peppermeshes-0.2.0-linux-x64-installer.run")
set(INSTALLER_MD5 9e78f24b52838e704210881f92c0983d)
else()
message(FATAL_ERROR "Mesh installer is not compatible with your host architecture '${CMAKE_HOST_SYSTEM_PROCESSOR}'")
endif()
file(DOWNLOAD ${INSTALLER_URL} ${INSTALLER_PATH}
SHOW_PROGRESS
INACTIVITY_TIMEOUT 60
EXPECTED_MD5 ${INSTALLER_MD5}
)
# specify the interesting folder in the archive. You might want to change
# that for a new binary where the structure is different
set(TMP_MESH_PATH ${TMP_DIR}/meshes)
# Where to install the meshes and textures
# relative to the share folder of the package.
set(INSTALL_DESTINATION_IN_SHARE ${PROJECT_NAME})
# install the meshes in the build directory when building
message(STATUS "Will unpack meshes from the installer: \n${INSTALLER_PATH} --prefix ${TMP_DIR} ${INSTALL_MODE_FLAG}")
add_custom_target(install_meshes ALL
COMMAND chmod +x ${INSTALLER_PATH}
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/install_with_auto_mode.sh ${INSTALLER_PATH} --prefix ${TMP_DIR}
BYPRODUCTS ${TMP_MESH_PATH}
TERMINAL
)
# install the archive
install(DIRECTORY ${TMP_MESH_PATH}
DESTINATION share/${PROJECT_NAME}
)
ament_package()