This repository has been archived by the owner on Sep 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
58 lines (42 loc) · 1.72 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
cmake_minimum_required(VERSION 2.8.3)
project(planning_simulator_launcher)
find_package(catkin REQUIRED COMPONENTS rospy)
catkin_package(CATKIN_DEPENDS rospy)
# ==== Install Python Scripts ==================================================
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/scripts/${PROJECT_NAME}/scenario_loader.py.cmake
${CMAKE_CURRENT_SOURCE_DIR}/scripts/${PROJECT_NAME}/scenario_loader.py)
file(
GLOB ${PROJECT_NAME}_SCRIPTS
${CMAKE_CURRENT_SOURCE_DIR}/scripts/${PROJECT_NAME}/*.py)
catkin_install_python(
PROGRAMS ${${PROJECT_NAME}_SCRIPTS}
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
# ==== Generate Default scenario_database.json =================================
file(
GLOB ${PROJECT_NAME}_DEFAULT_SCENARIOS_GLOB
${CMAKE_CURRENT_SOURCE_DIR}/scenario/debug/*.yaml)
function(convert reference delimiter)
list(GET ARGV 2 RESULT)
math(EXPR LENGTH "${ARGC}-1")
foreach(INDEX RANGE 3 ${LENGTH})
list(GET ARGV ${INDEX} EACH)
set(RESULT "${RESULT}\",\n \"${EACH}")
endforeach()
set(${reference} "${RESULT}" PARENT_SCOPE)
endfunction()
convert(${PROJECT_NAME}_DEFAULT_SCENARIOS ${${PROJECT_NAME}_DEFAULT_SCENARIOS_GLOB})
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/scenario_database_template.json
${CMAKE_CURRENT_SOURCE_DIR}/scenario_database_autoconf.json)
# install(
# FILES ${CMAKE_CURRENT_SOURCE_DIR}/scenario_database.json
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
# ==== Miscallenous ============================================================
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/launch
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
# install(
# DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/rviz
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# )