Skip to content

Commit

Permalink
fix build: include boost filesystem, app builds and runs using makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
vicrion committed Nov 3, 2024
1 parent 68eac4d commit 4692fbe
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
11 changes: 6 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)

add_definitions(-std=c++11)
add_definitions(-std=c++17)

set(CXX_FLAGS "-Wall")
set(CMAKE_CXX_FLAGS, "${CXX_FLAGS}")

project(playback)

find_package(PCL 1.2 REQUIRED)
find_package(Boost COMPONENTS filesystem REQUIRED)

include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
include_directories(${PCL_INCLUDE_DIRS} ${BOOST_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS} ${Boost_DEFINITIONS})
list(REMOVE_ITEM PCL_LIBRARIES "vtkproj4")


add_executable (environment src/environment.cpp src/render/render.cpp src/processPointClouds.cpp)
target_link_libraries (environment ${PCL_LIBRARIES})
target_link_libraries (environment ${PCL_LIBRARIES} ${Boost_LIBRARIES})



Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ BUILD.DIR=$(BASE.DIR)/build_cmd
build: .FORCE
rm -rf $(BUILD.DIR) && mkdir -p $(BUILD.DIR)
cmake $(BASE.DIR) -B$(BUILD.DIR) -DCMAKE_TOOLCHAIN_FILE=$(VCPKG.ROOT)/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=$(TRIPLET.NAME) -DVCPKG_HOST_TRIPLET=$(TRIPLET.NAME) -DVCPKG_BUILD_TYPE=release -DVCPKG_INSTALLED_DIR=$(BASE.DIR)/vcpkg_installed -DCMAKE_INSTALL_PREFIX=$(INSTALL.DIR) -DBUILD_SHARED_LIBS=0 -DSKIP_TESTS=0 && \
cd $(BUILD.DIR) && cmake --build . && VERBOSE=1 make install
cd $(BUILD.DIR) && cmake --build .

APP.BIN=$(BUILD.DIR)/environment
run: .FORCE
export LD_LIBRARY_PATH=$(BASE.DIR)/vcpkg_installed/$(TRIPLET.NAME)/lib:$(BASE.DIR)/vcpkg_installed/$(TRIPLET.NAME)/debug/lib:$(INSTALL.DIR)/lib && \
$(APP.BIN)

.FORCE:
13 changes: 8 additions & 5 deletions src/processPointClouds.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
#ifndef PROCESSPOINTCLOUDS_H_
#define PROCESSPOINTCLOUDS_H_

#include <iostream>
#include <string>
#include <vector>
#include <ctime>
#include <chrono>

#include <pcl/io/pcd_io.h>
#include <pcl/common/common.h>
#include <pcl/filters/extract_indices.h>
Expand All @@ -12,11 +18,8 @@
#include <pcl/segmentation/sac_segmentation.h>
#include <pcl/segmentation/extract_clusters.h>
#include <pcl/common/transforms.h>
#include <iostream>
#include <string>
#include <vector>
#include <ctime>
#include <chrono>
#include <boost/filesystem.hpp>

#include "render/box.h"

template<typename PointT>
Expand Down

0 comments on commit 4692fbe

Please sign in to comment.