check_object_files.cmake 780 B

1234567891011121314151617181920212223242526
  1. if (NOT EXISTS ${OBJLIB_LISTFILE})
  2. message(SEND_ERROR "Object listing file \"${OBJLIB_LISTFILE}\" not found!")
  3. endif()
  4. file(STRINGS ${OBJLIB_LISTFILE} objlib_files ENCODING UTF-8)
  5. list(LENGTH objlib_files num_objectfiles)
  6. if (NOT EXPECTED_NUM_OBJECTFILES EQUAL num_objectfiles)
  7. message(SEND_ERROR "Unexpected number of entries in object list file (${num_objectfiles} instead of ${EXPECTED_NUM_OBJECTFILES})")
  8. endif()
  9. foreach(objlib_file ${objlib_files})
  10. set(file_exists False)
  11. if (EXISTS ${objlib_file})
  12. set(file_exists True)
  13. endif()
  14. if (NOT file_exists)
  15. if(attempts)
  16. list(REMOVE_DUPLICATES attempts)
  17. set(tried " Tried ${attempts}")
  18. endif()
  19. message(SEND_ERROR "File \"${objlib_file}\" does not exist!${tried}")
  20. endif()
  21. endforeach()