diff options
author | Brad King <brad.king@kitware.com> | 2022-11-17 21:04:39 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-11-18 15:31:19 (GMT) |
commit | 591b75ee1711a5577962804414c02832e160e8dd (patch) | |
tree | 6c9e1b331eadd70515a7457e58633b833ea764f2 /Tests/RunCMake/find_dependency | |
parent | 43918087123d5ec5b6df3b7cb56c123a7adc5b90 (diff) | |
download | CMake-591b75ee1711a5577962804414c02832e160e8dd.zip CMake-591b75ee1711a5577962804414c02832e160e8dd.tar.gz CMake-591b75ee1711a5577962804414c02832e160e8dd.tar.bz2 |
Tests: Add case covering transitive find_dependency calls
Issue: #23685
Diffstat (limited to 'Tests/RunCMake/find_dependency')
8 files changed, 36 insertions, 0 deletions
diff --git a/Tests/RunCMake/find_dependency/RunCMakeTest.cmake b/Tests/RunCMake/find_dependency/RunCMakeTest.cmake index a72d189..6a53133 100644 --- a/Tests/RunCMake/find_dependency/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_dependency/RunCMakeTest.cmake @@ -3,6 +3,7 @@ include(RunCMake) # Success tests run_cmake(realistic) run_cmake(basic) +run_cmake(transitive) # Failure tests run_cmake(invalid-arg) diff --git a/Tests/RunCMake/find_dependency/transitive-stdout.txt b/Tests/RunCMake/find_dependency/transitive-stdout.txt new file mode 100644 index 0000000..0f5b366 --- /dev/null +++ b/Tests/RunCMake/find_dependency/transitive-stdout.txt @@ -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 diff --git a/Tests/RunCMake/find_dependency/transitive.cmake b/Tests/RunCMake/find_dependency/transitive.cmake new file mode 100644 index 0000000..5a07f96 --- /dev/null +++ b/Tests/RunCMake/find_dependency/transitive.cmake @@ -0,0 +1,3 @@ +message(STATUS "begin") +find_package(E REQUIRED NO_DEFAULT_PATH PATHS ${CMAKE_CURRENT_SOURCE_DIR}/transitive) +message(STATUS "end") diff --git a/Tests/RunCMake/find_dependency/transitive/AConfig.cmake b/Tests/RunCMake/find_dependency/transitive/AConfig.cmake new file mode 100644 index 0000000..b2bf294 --- /dev/null +++ b/Tests/RunCMake/find_dependency/transitive/AConfig.cmake @@ -0,0 +1 @@ +message(STATUS "Loading A with components: '${A_FIND_COMPONENTS}'") diff --git a/Tests/RunCMake/find_dependency/transitive/BConfig.cmake b/Tests/RunCMake/find_dependency/transitive/BConfig.cmake new file mode 100644 index 0000000..42c2ecd --- /dev/null +++ b/Tests/RunCMake/find_dependency/transitive/BConfig.cmake @@ -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}) diff --git a/Tests/RunCMake/find_dependency/transitive/CConfig.cmake b/Tests/RunCMake/find_dependency/transitive/CConfig.cmake new file mode 100644 index 0000000..645aedc --- /dev/null +++ b/Tests/RunCMake/find_dependency/transitive/CConfig.cmake @@ -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}) diff --git a/Tests/RunCMake/find_dependency/transitive/DConfig.cmake b/Tests/RunCMake/find_dependency/transitive/DConfig.cmake new file mode 100644 index 0000000..488c85b --- /dev/null +++ b/Tests/RunCMake/find_dependency/transitive/DConfig.cmake @@ -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}) diff --git a/Tests/RunCMake/find_dependency/transitive/EConfig.cmake b/Tests/RunCMake/find_dependency/transitive/EConfig.cmake new file mode 100644 index 0000000..c8d31de --- /dev/null +++ b/Tests/RunCMake/find_dependency/transitive/EConfig.cmake @@ -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}) |