diff --git a/cmake/packages.cmake b/cmake/packages.cmake index dc4adf32..cbed3c14 100644 --- a/cmake/packages.cmake +++ b/cmake/packages.cmake @@ -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} @@ -129,4 +131,4 @@ else() yaml-cpp tbb ) -endif () \ No newline at end of file +endif() diff --git a/src/ch5/CMakeLists.txt b/src/ch5/CMakeLists.txt index e6c4ce6e..26b8de41 100644 --- a/src/ch5/CMakeLists.txt +++ b/src/ch5/CMakeLists.txt @@ -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 @@ -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()