gabyx / ApproxMVBB

Fast algorithms to compute an approximation of the minimal volume oriented bounding box of a point cloud in 3D.
Mozilla Public License 2.0
441 stars 93 forks source link

Problem using installed the library by non-system generic location #51

Open MingmChen opened 3 months ago

MingmChen commented 3 months ago

I try to link the ApproxMVBB::Core library in my own project like this:

`

--- Find MVBB dependencies

include(${CMAKE_CURRENT_SOURCE_DIR}/SetTargetCompileOptions.cmake) set(ApproxMVBB_DIR "E:/017MinimumBoundingBox/ApproxMVBB-MVBB/build/install/cmake") get_filename_component( ApproxMVBB_DIR ${ApproxMVBB_DIR} ABSOLUTE ) message(STATUS "ApproxMVBB_DIR:" ${ApproxMVBB_DIR})

Add ApproxMVBB

find_package(ApproxMVBB REQUIRED COMPONENTS XML_SUPPORT KDTREE_SUPPORT)

add_executable(${PROJECT_NAME} test_approx_mvbb.cpp) setTargetCompileOptions(${PROJECT_NAME}) target_link_libraries(${PROJECT_NAME} ApproxMVBB::Core) `

and it works well, but when I add a new library such as pcl it break down. Code in CmakeLists.txt is like this: `

--- Find PCL dependencies

find_package(PCL 1.12 REQUIRED)

include_directories(${PCL_INCLUDE_DIRS}) link_directories(${PCL_LIBRARY_DIRS}) add_definitions(${PCL_DEFINITIONS})

--- Find MVBB dependencies

`include(${CMAKE_CURRENT_SOURCE_DIR}/SetTargetCompileOptions.cmake) set(ApproxMVBB_DIR "E:/017MinimumBoundingBox/ApproxMVBB-MVBB/build/install/cmake") get_filename_component( ApproxMVBB_DIR ${ApproxMVBB_DIR} ABSOLUTE ) message(STATUS "ApproxMVBB_DIR:" ${ApproxMVBB_DIR})

Add ApproxMVBB

find_package(ApproxMVBB REQUIRED COMPONENTS XML_SUPPORT KDTREE_SUPPORT)

link_directories(${LIBRARY_OUTPUT_PATH})

add_executable(${PROJECT_NAME} test_approx_mvbb.cpp ) setTargetCompileOptions(${PROJECT_NAME}) target_link_libraries(${PROJECT_NAME} ApproxMVBB::Core ${PCL_LIBRARIES}) `

When I using the library PCL or ApproxMVBB respectively, it works well. What is the problem?

Looking forward to your reply. Best wishes.