Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MingmChen opened this issue Jun 3, 2024 · 0 comments
Open

Comments

@MingmChen
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant