Skip to content

Commit

Permalink
Fix CMake for log writing example
Browse files Browse the repository at this point in the history
  • Loading branch information
tprk77 committed Apr 16, 2023
1 parent 063a555 commit 25ba23c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 291 deletions.
24 changes: 14 additions & 10 deletions examples/cpp/lcm_log_writer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
project(lcm_log_writer)
cmake_minimum_required(VERSION 3.1)

add_compile_options("-std=c++11")
set(CMAKE_BUILD_TYPE "Release")
project(lcm_log_writer)

find_package(lcm REQUIRED)
include(${LCM_USE_FILE})

# Import LCM via pkgconfig.
find_package(PkgConfig REQUIRED)
pkg_check_modules(LCM REQUIRED lcm)
include_directories(${LCM_INCLUDE_DIRS})
link_libraries(${LCM_LDFLAGS})
# Generate header from message definition
lcm_wrap_types(CPP_HEADERS pjs_cpp_headers
pronto_joint_state_t.lcm)

include_directories("${PROJECT_SOURCE_DIR}/include")
# Create library from the message
lcm_add_library(pjs_messages-cpp CPP ${pjs_cpp_headers})
target_include_directories(pjs_messages-cpp INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)

add_executable(${PROJECT_NAME} ${PROJECT_SOURCE_DIR}/main.cpp)
# Create executable
add_executable(lcm_log_writer "main.cpp")
lcm_target_link_libraries(lcm_log_writer pjs_messages-cpp ${LCM_NAMESPACE}lcm)
280 changes: 0 additions & 280 deletions examples/cpp/lcm_log_writer/include/joint_state_t.hpp

This file was deleted.

2 changes: 1 addition & 1 deletion examples/cpp/lcm_log_writer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#include <cmath>
#include <fstream>
#include <iostream>
#include <joint_state_t.hpp>
#include <lcm/lcm-cpp.hpp>
#include <pronto/joint_state_t.hpp>
#include <string>

using namespace std;
Expand Down

0 comments on commit 25ba23c

Please sign in to comment.