Files
CMake/Tests/RunCMake/export/FindDependencyExportFetchContent-check.cmake
Kyle Edwards c6e6861e63 install(EXPORT): Export find_dependency() calls
Issue: #20511
Co-Authored-by: Brad King <brad.king@kitware.com>
Co-Authored-by: Robert Maynard <rmaynard@nvidia.com>
2023-11-13 11:07:52 -05:00

15 lines
766 B
CMake

file(READ "${RunCMake_TEST_BINARY_DIR}/my_private_targets.cmake" my_private_targets)
if(NOT "${my_private_targets}" MATCHES "find_dependency\\(HasDeps")
string(APPEND RunCMake_TEST_FAILED "HasDeps dependency should be exported but it is not\n")
endif()
file(READ "${RunCMake_TEST_BINARY_DIR}/my_static_targets.cmake" my_static_targets)
if(NOT "${my_static_targets}" MATCHES "find_dependency\\(MyPrivate")
string(APPEND RunCMake_TEST_FAILED "HasDeps dependency should be exported but it is not\n")
endif()
file(READ "${RunCMake_TEST_BINARY_DIR}/my_shared_targets.cmake" my_shared_targets)
if(NOT "${my_shared_targets}" MATCHES "find_dependency\\(MyPrivate")
string(APPEND RunCMake_TEST_FAILED "MyStatic dependency should be exported but it is not\n")
endif()