mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-24 07:28:54 -06:00
When a dependency was already found, find_dependency did not search it again. While this works in basic case, it does not when there are components as the check does not take components into account. Given the fact that there is no documentation about this optimization and that the correct implementation is not trivial as it would require changes in find_package to have the list of components already found we always search dependencies. Fix #17583.
15 lines
534 B
CMake
15 lines
534 B
CMake
if(NOT Pack7_FOUND)
|
|
set(Pack7_FOUND 1)
|
|
add_library(Pack7::Pack7 INTERFACE IMPORTED)
|
|
set_property(TARGET Pack7::Pack7 PROPERTY INTERFACE_COMPILE_DEFINITIONS HAVE_PACK7)
|
|
endif()
|
|
|
|
foreach(module ${Pack7_FIND_COMPONENTS})
|
|
if(module STREQUAL "Comp1")
|
|
add_library(Pack7::Comp1 INTERFACE IMPORTED)
|
|
set_property(TARGET Pack7::Comp1 PROPERTY INTERFACE_COMPILE_DEFINITIONS HAVE_PACK7_COMP1)
|
|
set_property(TARGET Pack7::Comp1 PROPERTY INTERFACE_LINK_LIBRARIES Pack7::Pack7)
|
|
set(Pack7_Comp1_FOUND 1)
|
|
endif()
|
|
endforeach()
|