diff options
author | Brad King <brad.king@kitware.com> | 2024-03-12 12:43:07 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2024-03-12 12:43:24 (GMT) |
commit | 3677b2d916fb8d3ba5ff4eac0115f905b9727f9d (patch) | |
tree | de7e7ebc622f49d7b7fe6ecb2be7992cfdf1adb6 | |
parent | 04d8bc6bb9727b667b8a0d339c7803befce337f2 (diff) | |
parent | b1c48069149fcd9ff128286cb059138b1df96c8f (diff) | |
download | CMake-3677b2d916fb8d3ba5ff4eac0115f905b9727f9d.zip CMake-3677b2d916fb8d3ba5ff4eac0115f905b9727f9d.tar.gz CMake-3677b2d916fb8d3ba5ff4eac0115f905b9727f9d.tar.bz2 |
Merge topic 'export-find_dependency-calls' into release-3.29
b1c4806914 install(EXPORT): Drop REQUIRED from exported find_dependency calls
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9329
-rw-r--r-- | Source/cmExportFileGenerator.cxx | 2 | ||||
-rw-r--r-- | Tests/RunCMake/export/FindDependencyExport-check.cmake | 8 | ||||
-rw-r--r-- | Tests/RunCMake/install/EXPORT-FindDependencyExport-all-check.cmake | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 37af5f0..f60a17e 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -1260,7 +1260,7 @@ void cmExportFileGenerator::GenerateFindDependencyCalls(std::ostream& os) for (auto const& it : packageDependenciesSorted) { if (it.second.Enabled == cmExportSet::PackageDependencyExportEnabled::On) { - os << "find_dependency(" << it.first << " REQUIRED"; + os << "find_dependency(" << it.first; for (auto const& arg : it.second.ExtraArguments) { os << " " << cmOutputConverter::EscapeForCMake(arg); } 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") diff --git a/Tests/RunCMake/install/EXPORT-FindDependencyExport-all-check.cmake b/Tests/RunCMake/install/EXPORT-FindDependencyExport-all-check.cmake index 6a8b2e5..9b41436 100644 --- a/Tests/RunCMake/install/EXPORT-FindDependencyExport-all-check.cmake +++ b/Tests/RunCMake/install/EXPORT-FindDependencyExport-all-check.cmake @@ -1,4 +1,4 @@ file(READ "${RunCMake_TEST_BINARY_DIR}/root-all/lib/cmake/mylib/mylib-targets.cmake" contents) -if(NOT contents MATCHES "include\\(CMakeFindDependencyMacro\\)\nfind_dependency\\(P2 REQUIRED\\)\nfind_dependency\\(P1 REQUIRED\\)\n") +if(NOT contents MATCHES "include\\(CMakeFindDependencyMacro\\)\nfind_dependency\\(P2\\)\nfind_dependency\\(P1\\)\n") set(RunCMake_TEST_FAILED "Dependencies were not properly exported") endif() |