1
0

ExplicitCMakeLists-check.cmake 642 B

1234567891011121314151617181920
  1. set(xcProjectFile "${RunCMake_TEST_BINARY_DIR}/ExplicitCMakeLists.xcodeproj/project.pbxproj")
  2. if(NOT EXISTS "${xcProjectFile}")
  3. set(RunCMake_TEST_FAILED "Project file ${xcProjectFile} does not exist.")
  4. return()
  5. endif()
  6. set(foundCMakeLists 0)
  7. file(STRINGS "${xcProjectFile}" lines)
  8. foreach(line IN LISTS lines)
  9. if(line MATCHES "PBXBuildFile.*fileRef.*CMakeLists.txt")
  10. if(foundCMakeLists)
  11. set(RunCMake_TEST_FAILED "CMakeLists.txt referenced multiple times")
  12. return()
  13. endif()
  14. set(foundCMakeLists 1)
  15. endif()
  16. endforeach()
  17. if(NOT foundCMakeLists)
  18. set(RunCMake_TEST_FAILED "CMakeLists.txt not referenced")
  19. endif()