Skip to content

Commit

Permalink
Merge pull request #2428 from taketwo/fix-2427
Browse files Browse the repository at this point in the history
Do not search for PCL components that have been found already
  • Loading branch information
SergioRAgostinho authored Sep 10, 2018
2 parents d3d3d29 + 02531d2 commit 6bd7bd1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions PCLConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,20 @@ else(PCL_FIND_COMPONENTS)
set(PCL_FIND_ALL 1)
endif(PCL_FIND_COMPONENTS)

# We do not need to find components that have been found already, e.g. during previous invocation
# of find_package(PCL). Filter them out.
foreach(component ${PCL_TO_FIND_COMPONENTS})
if(NOT TARGET pcl_${component})
list(APPEND _PCL_TO_FIND_COMPONENTS ${component})
endif()
endforeach()
set(PCL_TO_FIND_COMPONENTS ${_PCL_TO_FIND_COMPONENTS})
unset(_PCL_TO_FIND_COMPONENTS)

if(NOT PCL_TO_FIND_COMPONENTS)
return()
endif()

compute_dependencies(PCL_TO_FIND_COMPONENTS)

# compute external dependencies per component
Expand Down

0 comments on commit 6bd7bd1

Please sign in to comment.