SameGenerator.cmake 495 B

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