VerifyResult.cmake 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. message(STATUS "=============================================================================")
  2. message(STATUS "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)")
  3. message(STATUS "")
  4. if(NOT CPackComponents_BINARY_DIR)
  5. message(FATAL_ERROR "CPackComponents_BINARY_DIR not set")
  6. endif()
  7. set(expected_file_mask "")
  8. if(WIN32)
  9. # Only expect the *.exe installer if it looks like NSIS is
  10. # installed on this machine:
  11. #
  12. find_program(NSIS_MAKENSIS_EXECUTABLE NAMES makensis
  13. PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS]
  14. DOC "makensis.exe location"
  15. )
  16. if(NSIS_MAKENSIS_EXECUTABLE)
  17. set(expected_file_mask "${CPackComponents_BINARY_DIR}/MyLib-*.exe")
  18. endif()
  19. endif()
  20. if(APPLE)
  21. # Always expect the *.dmg installer - PackageMaker should always
  22. # be installed on a development Mac:
  23. #
  24. set(expected_file_mask "${CPackComponents_BINARY_DIR}/MyLib-*.dmg")
  25. endif()
  26. if(expected_file_mask)
  27. set(expected_count 1)
  28. file(GLOB expected_file "${expected_file_mask}")
  29. message(STATUS "expected_count='${expected_count}'")
  30. message(STATUS "expected_file='${expected_file}'")
  31. message(STATUS "expected_file_mask='${expected_file_mask}'")
  32. if(NOT expected_file)
  33. message(FATAL_ERROR "error: expected_file does not exist: CPackComponents test fails.")
  34. endif()
  35. list(LENGTH expected_file actual_count)
  36. message(STATUS "actual_count='${actual_count}'")
  37. if(NOT actual_count EQUAL expected_count)
  38. message(FATAL_ERROR "error: expected_count does not match actual_count: CPackComponents test fails.")
  39. endif()
  40. endif()