SameGenerator.cmake 464 B

1234567891011121314151617
  1. include(FetchContent)
  2. FetchContent_Declare(
  3. t1
  4. DOWNLOAD_COMMAND ${CMAKE_COMMAND} -E echo "Download command executed"
  5. )
  6. FetchContent_Populate(t1)
  7. file(STRINGS "${FETCHCONTENT_BASE_DIR}/t1-subbuild/CMakeCache.txt"
  8. matchLine REGEX "^CMAKE_GENERATOR:.*="
  9. LIMIT_COUNT 1
  10. )
  11. if(NOT matchLine MATCHES "${CMAKE_GENERATOR}")
  12. message(FATAL_ERROR "Generator line mismatch: ${matchLine}\n"
  13. " Expected type: ${CMAKE_GENERATOR}")
  14. endif()