summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/export
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-03-11 15:57:41 (GMT)
committerBrad King <brad.king@kitware.com>2024-03-11 16:07:32 (GMT)
commitb1c48069149fcd9ff128286cb059138b1df96c8f (patch)
treede7e7ebc622f49d7b7fe6ecb2be7992cfdf1adb6 /Tests/RunCMake/export
parent04d8bc6bb9727b667b8a0d339c7803befce337f2 (diff)
downloadCMake-b1c48069149fcd9ff128286cb059138b1df96c8f.zip
CMake-b1c48069149fcd9ff128286cb059138b1df96c8f.tar.gz
CMake-b1c48069149fcd9ff128286cb059138b1df96c8f.tar.bz2
install(EXPORT): Drop REQUIRED from exported find_dependency calls
In commit c6e6861e63 (install(EXPORT): Export find_dependency() calls, 2023-11-07, v3.29.0-rc1~439^2~1) we made the calls `REQUIRED`. However, a dependency is only required if the dependent package is required. `find_dependency` already forwards the `REQUIRED` mark, and also already marks the dependent package as not found if the dependency is missing. Fixes: #25756
Diffstat (limited to 'Tests/RunCMake/export')
-rw-r--r--Tests/RunCMake/export/FindDependencyExport-check.cmake8
1 files changed, 4 insertions, 4 deletions
diff --git a/Tests/RunCMake/export/FindDependencyExport-check.cmake b/Tests/RunCMake/export/FindDependencyExport-check.cmake
index 0cbb195..6917c26 100644
--- a/Tests/RunCMake/export/FindDependencyExport-check.cmake
+++ b/Tests/RunCMake/export/FindDependencyExport-check.cmake
@@ -2,19 +2,19 @@ file(READ "${RunCMake_TEST_BINARY_DIR}/mytargets.cmake" mytargets)
if("${mytargets}" MATCHES "find_dependency\\(P1")
string(APPEND RunCMake_TEST_FAILED "P1 dependency should not be exported but it is\n")
endif()
-if(NOT "${mytargets}" MATCHES "find_dependency\\(P2 REQUIRED \"VERSION\" \"1\\.0\"\\)")
+if(NOT "${mytargets}" MATCHES "find_dependency\\(P2 \"VERSION\" \"1\\.0\"\\)")
string(APPEND RunCMake_TEST_FAILED "P2 dependency should be exported but it is not\n")
endif()
-if(NOT "${mytargets}" MATCHES "find_dependency\\(P3 REQUIRED\\)")
+if(NOT "${mytargets}" MATCHES "find_dependency\\(P3\\)")
string(APPEND RunCMake_TEST_FAILED "P3 dependency should be exported but it is not\n")
endif()
-if(NOT "${mytargets}" MATCHES "find_dependency\\(P4 REQUIRED\\)")
+if(NOT "${mytargets}" MATCHES "find_dependency\\(P4\\)")
string(APPEND RunCMake_TEST_FAILED "P4 dependency should be exported but it is not\n")
endif()
if("${mytargets}" MATCHES "find_dependency\\(P5")
string(APPEND RunCMake_TEST_FAILED "P5 dependency should not be exported but it is\n")
endif()
-if(NOT "${mytargets}" MATCHES "find_dependency\\(P6 REQUIRED\\)")
+if(NOT "${mytargets}" MATCHES "find_dependency\\(P6\\)")
string(APPEND RunCMake_TEST_FAILED "P6 dependency should be exported but it is not\n")
endif()
if("${mytargets}" MATCHES "find_dependency\\(P7")