diff options
author | Craig Scott <craig.scott@crascit.com> | 2017-09-24 09:50:58 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2017-10-16 21:10:19 (GMT) |
commit | 1e56634faa44c9a26b0e7a4f529396d761f8833d (patch) | |
tree | b47226609b179c3659d0f27355a37881937c91a3 /Tests/RunCMake/FetchContent/SameGenerator.cmake | |
parent | 60e74d2f19d33e5b8afc7f8834f36c5cb1d2c810 (diff) | |
download | CMake-1e56634faa44c9a26b0e7a4f529396d761f8833d.zip CMake-1e56634faa44c9a26b0e7a4f529396d761f8833d.tar.gz CMake-1e56634faa44c9a26b0e7a4f529396d761f8833d.tar.bz2 |
FetchContent: Add tests
Diffstat (limited to 'Tests/RunCMake/FetchContent/SameGenerator.cmake')
-rw-r--r-- | Tests/RunCMake/FetchContent/SameGenerator.cmake | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Tests/RunCMake/FetchContent/SameGenerator.cmake b/Tests/RunCMake/FetchContent/SameGenerator.cmake new file mode 100644 index 0000000..58204ef --- /dev/null +++ b/Tests/RunCMake/FetchContent/SameGenerator.cmake @@ -0,0 +1,17 @@ +include(FetchContent) + +FetchContent_Declare( + t1 + DOWNLOAD_COMMAND ${CMAKE_COMMAND} -E echo "Download command executed" +) + +FetchContent_Populate(t1) + +file(STRINGS "${FETCHCONTENT_BASE_DIR}/t1-subbuild/CMakeCache.txt" + matchLine REGEX "^CMAKE_GENERATOR:.*=" + LIMIT_COUNT 1 +) +if(NOT matchLine MATCHES "${CMAKE_GENERATOR}") + message(FATAL_ERROR "Generator line mismatch: ${matchLine}\n" + " Expected type: ${CMAKE_GENERATOR}") +endif() |