Skip to content

Commit

Permalink
Do not search for PCL components that have been found already
Browse files Browse the repository at this point in the history
  • Loading branch information
taketwo committed Sep 10, 2018
1 parent d3d3d29 commit 21d3cd2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions PCLConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,21 @@ 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})
string(TOUPPER "${component}" COMPONENT)
if(NOT PCL_${COMPONENT}_FOUND)
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 21d3cd2

Please sign in to comment.