Skip to content

Instantly share code, notes, and snippets.

@RichardKelley
Forked from linknum23/CMakeLists.txt
Created August 2, 2017 14:13
Show Gist options
  • Save RichardKelley/28092b29c4b41452a955a2a30ce3503b to your computer and use it in GitHub Desktop.
Save RichardKelley/28092b29c4b41452a955a2a30ce3503b to your computer and use it in GitHub Desktop.
CMakeList configuration for compiling ROS and Driveworks on a Tegra (Drive PX2)
cmake_minimum_required(VERSION 3.1)
project(dw_wrapper)
set (CMAKE_CXX_STANDARD 11)
# FindDriveworks.cmake, ArchConfiguration.cmake, and LibFindMacros.cmake were needed for my setup they are taken from driveworks/samples/cmake/
# ArchConfiguration.cmake was the only file that needed small changes, remove the fatal error on line 17 and add the following lines in its place
# set(VIBRANTE TRUE)
# add_definitions(-DVIBRANTE)
# this is the path I placed the driveworks cmake files in
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/dw_ros/cmake/Modules/")
find_package(CUDA REQUIRED)
find_package(Threads REQUIRED)
find_package(GLEW REQUIRED)
find_package(Driveworks REQUIRED)
find_package(catkin REQUIRED COMPONENTS
roscpp
geometry_msgs
)
catkin_package(
LIBRARIES ${PROJECT_NAME}
)
include_directories(
${catkin_INCLUDE_DIRS}
${Driveworks_INCLUDE_DIRS}
${CUDA_INCLUDE_DIRS}
)
# TODO: add a FindNvmedia.cmake file for this? Why does it not exist?
include_directories(/usr/share/visionworks/sources/3rdparty/nvmedia/)
add_library(${PROJECT_NAME}
src/DWLanesNode.cpp
)
target_link_libraries(${PROJECT_NAME}
${catkin_LIBRARIES}
${Driveworks_LIBRARIES}
)
# ros node name template
set(NODE_NAME ${PROJECT_NAME}_node)
add_executable(${NODE_NAME} src/${NODE_NAME}.cpp)
target_link_libraries(${NODE_NAME}
${PROJECT_NAME}
)
<?xml version="1.0"?>
<package format="2">
<name>dw_wrapper</name>
<version>1.0.0</version>
<description>
Wrapper for Nvidia Driveworks
</description>
<buildtool_depend>catkin</buildtool_depend>
<depend>roscpp</depend>
<depend>libglew-dev</depend><!--TODO: Figure out what actually needs this library-->
</package>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment