Tests: Add case covering transitive find_dependency calls

Issue: #23685
This commit is contained in:
Brad King 2022-11-17 16:04:39 -05:00
parent 4391808712
commit 591b75ee17
8 changed files with 36 additions and 0 deletions

View File

@ -3,6 +3,7 @@ include(RunCMake)
# Success tests
run_cmake(realistic)
run_cmake(basic)
run_cmake(transitive)
# Failure tests
run_cmake(invalid-arg)

View File

@ -0,0 +1,14 @@
-- begin
-- Loading E with components: ''
-- Loading A with components: 'A1'
-- Loading B with components: 'B1'
-- Loading A with components: ''
-- Loading C with components: ''
-- Loading A with components: ''
-- Loading D with components: ''
-- Loading A with components: 'A1'
-- Loading B with components: ''
-- Loading A with components: ''
-- Loading C with components: ''
-- Loading A with components: ''
-- end

View File

@ -0,0 +1,3 @@
message(STATUS "begin")
find_package(E REQUIRED NO_DEFAULT_PATH PATHS ${CMAKE_CURRENT_SOURCE_DIR}/transitive)
message(STATUS "end")

View File

@ -0,0 +1 @@
message(STATUS "Loading A with components: '${A_FIND_COMPONENTS}'")

View File

@ -0,0 +1,3 @@
message(STATUS "Loading B with components: '${B_FIND_COMPONENTS}'")
include(CMakeFindDependencyMacro)
find_dependency(A NO_DEFAULT_PATH PATHS ${CMAKE_CURRENT_LIST_DIR})

View File

@ -0,0 +1,3 @@
message(STATUS "Loading C with components: '${C_FIND_COMPONENTS}'")
include(CMakeFindDependencyMacro)
find_dependency(A NO_DEFAULT_PATH PATHS ${CMAKE_CURRENT_LIST_DIR})

View File

@ -0,0 +1,5 @@
message(STATUS "Loading D with components: '${D_FIND_COMPONENTS}'")
include(CMakeFindDependencyMacro)
find_dependency(A COMPONENTS A1 NO_DEFAULT_PATH PATHS ${CMAKE_CURRENT_LIST_DIR})
find_dependency(B NO_DEFAULT_PATH PATHS ${CMAKE_CURRENT_LIST_DIR})
find_dependency(C NO_DEFAULT_PATH PATHS ${CMAKE_CURRENT_LIST_DIR})

View File

@ -0,0 +1,6 @@
message(STATUS "Loading E with components: '${E_FIND_COMPONENTS}'")
include(CMakeFindDependencyMacro)
find_dependency(A COMPONENTS A1 NO_DEFAULT_PATH PATHS ${CMAKE_CURRENT_LIST_DIR})
find_dependency(B COMPONENTS B1 NO_DEFAULT_PATH PATHS ${CMAKE_CURRENT_LIST_DIR})
find_dependency(C NO_DEFAULT_PATH PATHS ${CMAKE_CURRENT_LIST_DIR})
find_dependency(D NO_DEFAULT_PATH PATHS ${CMAKE_CURRENT_LIST_DIR})