Skip to content

Commit

Permalink
fix build on ubuntu 18.04
Browse files Browse the repository at this point in the history
  • Loading branch information
wangg12 committed Feb 18, 2023
1 parent e101928 commit 1045b82
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
4 changes: 3 additions & 1 deletion cmake/packages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ if(BUILD_WITH_UBUNTU1804)
include_directories(${PROJECT_SOURCE_DIR}/thirdparty/tbb/oneTBB-2019_U8/oneTBB-2019_U8/include)
link_directories(${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/tbb_release)

find_package(GTest CONFIG REQUIRED)

set(third_party_libs
${catkin_LIBRARIES}
${g2o_libs}
Expand All @@ -129,4 +131,4 @@ else()
yaml-cpp
tbb
)
endif ()
endif()
16 changes: 14 additions & 2 deletions src/ch5/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,15 @@ add_library(${PROJECT_NAME}.ch5
kdtree.cc
octo_tree.cc
)
target_link_libraries(${PROJECT_NAME}.ch5
if (BUILD_WITH_UBUNTU1804)
target_link_libraries(${PROJECT_NAME}.ch5
TBB::tbb
)
else()
target_link_libraries(${PROJECT_NAME}.ch5
tbb
)
endif()

add_executable(linear_fitting linear_fitting.cc)
target_link_libraries(linear_fitting
Expand All @@ -41,6 +47,12 @@ target_link_libraries(linear_fitting
ADD_EXECUTABLE(test_nn test_nn.cc)
ADD_TEST(test_nn test_bfnn)

target_link_libraries(test_nn
if (BUILD_WITH_UBUNTU1804)
target_link_libraries(test_nn
GTest::gtest pthread glog gflags ${PROJECT_NAME}.ch5 ${PROJECT_NAME}.common ${PCL_LIBRARIES} TBB::tbb
)
else()
target_link_libraries(test_nn
gtest pthread glog gflags ${PROJECT_NAME}.ch5 ${PROJECT_NAME}.common ${PCL_LIBRARIES} tbb
)
endif()

0 comments on commit 1045b82

Please sign in to comment.