FindDependencyExport-check.cmake 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. file(READ "${RunCMake_TEST_BINARY_DIR}/mytargets.cmake" mytargets)
  2. if("${mytargets}" MATCHES "find_dependency\\(P1")
  3. string(APPEND RunCMake_TEST_FAILED "P1 dependency should not be exported but it is\n")
  4. endif()
  5. if(NOT "${mytargets}" MATCHES "find_dependency\\(P2 REQUIRED \"VERSION\" \"1\\.0\"\\)")
  6. string(APPEND RunCMake_TEST_FAILED "P2 dependency should be exported but it is not\n")
  7. endif()
  8. if(NOT "${mytargets}" MATCHES "find_dependency\\(P3 REQUIRED\\)")
  9. string(APPEND RunCMake_TEST_FAILED "P3 dependency should be exported but it is not\n")
  10. endif()
  11. if(NOT "${mytargets}" MATCHES "find_dependency\\(P4 REQUIRED\\)")
  12. string(APPEND RunCMake_TEST_FAILED "P4 dependency should be exported but it is not\n")
  13. endif()
  14. if("${mytargets}" MATCHES "find_dependency\\(P5")
  15. string(APPEND RunCMake_TEST_FAILED "P5 dependency should not be exported but it is\n")
  16. endif()
  17. if(NOT "${mytargets}" MATCHES "find_dependency\\(P6 REQUIRED\\)")
  18. string(APPEND RunCMake_TEST_FAILED "P6 dependency should be exported but it is not\n")
  19. endif()
  20. if("${mytargets}" MATCHES "find_dependency\\(P7")
  21. string(APPEND RunCMake_TEST_FAILED "P7 dependency should not be exported but it is\n")
  22. endif()
  23. if(NOT "${mytargets}" MATCHES "find_dependency\\(P3[^
  24. ]*\\)
  25. find_dependency\\(P2[^
  26. ]*\\)
  27. find_dependency\\(P8[^
  28. ]*\\)
  29. find_dependency\\(P6[^
  30. ]*\\)
  31. find_dependency\\(P9[^
  32. ]*\\)
  33. find_dependency\\(P4")
  34. string(APPEND RunCMake_TEST_FAILED "Dependencies are not in the correct order\n")
  35. endif()