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

Set FLANN_ROOT in FindFLANN.cmake #3220

Merged
merged 1 commit into from
Jul 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion PCLConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ macro(find_flann)
if(PCL_ALL_IN_ONE_INSTALLER)
set(FLANN_ROOT "${PCL_ROOT}/3rdParty/Flann")
elseif(NOT FLANN_ROOT)
get_filename_component(FLANN_ROOT "@FLANN_INCLUDE_DIRS@" PATH)
set(FLANN_ROOT "@FLANN_ROOT@")
endif()

set(FLANN_USE_STATIC @FLANN_USE_STATIC@)
Expand Down
6 changes: 6 additions & 0 deletions cmake/Modules/FindFLANN.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# ::
#
# FLANN_FOUND True in case FLANN is found, otherwise false
# FLANN_ROOT Path to the root of found FLANN installation
#
# Example usage
# ^^^^^^^^^^^^^
Expand All @@ -45,6 +46,10 @@ if(flann_FOUND)
else()
set_property(TARGET FLANN::FLANN APPEND PROPERTY INTERFACE_LINK_LIBRARIES flann::flann_cpp)
endif()
# Determine FLANN installation root based on the path to the processed Config file
get_filename_component(_config_dir "${flann_CONFIG}" DIRECTORY)
get_filename_component(FLANN_ROOT "${_config_dir}/../../.." ABSOLUTE)
unset(_config_dir)
return()
endif()

Expand Down Expand Up @@ -136,4 +141,5 @@ if(FLANN_FOUND)
endif()
endif()
endif()
get_filename_component(FLANN_ROOT "${FLANN_INCLUDE_DIR}" PATH)
endif()
1 change: 0 additions & 1 deletion cmake/pcl_all_in_one_installer.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ get_filename_component(BOOST_ROOT "${Boost_INCLUDE_DIR}" PATH)
get_filename_component(BOOST_ROOT "${BOOST_ROOT}" PATH)
get_filename_component(EIGEN_ROOT "${EIGEN_INCLUDE_DIRS}" PATH)
get_filename_component(QHULL_ROOT "${QHULL_INCLUDE_DIRS}" PATH)
get_filename_component(FLANN_ROOT "${FLANN_INCLUDE_DIRS}" PATH)
get_filename_component(VTK_ROOT "${VTK_DIR}" PATH)
get_filename_component(VTK_ROOT "${VTK_ROOT}" PATH)
get_filename_component(VTK_ROOT "${VTK_ROOT}" PATH)
Expand Down