diff options
author | Robert Maynard <rmaynard@nvidia.com> | 2022-01-18 16:52:48 (GMT) |
---|---|---|
committer | Robert Maynard <rmaynard@nvidia.com> | 2022-01-18 16:53:21 (GMT) |
commit | 2e1b7e5b9ae879406a2dfedf589343a222b67f00 (patch) | |
tree | c681dbac07bb51ada71f3d3d5cdb6a4c72446973 /Tests/RunCMake/CommandLine | |
parent | a0e78cc30c9c3ab71ef6030cc30e4be51468ffb4 (diff) | |
download | CMake-2e1b7e5b9ae879406a2dfedf589343a222b67f00.zip CMake-2e1b7e5b9ae879406a2dfedf589343a222b67f00.tar.gz CMake-2e1b7e5b9ae879406a2dfedf589343a222b67f00.tar.bz2 |
Add tests that showcase cmake -S limitations
Diffstat (limited to 'Tests/RunCMake/CommandLine')
-rw-r--r-- | Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index 74cd90a..3622e64 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -130,6 +130,19 @@ project(ExplicitDirsMissing LANGUAGES NONE) set(RunCMake_TEST_BINARY_DIR "${source_dir}") run_cmake_with_options(no-S-B -DFOO=BAR) + file(WRITE ${source_dir}/CMakeLists.txt [=[ +cmake_minimum_required(VERSION 3.13) +project(ExplicitDirsMissing LANGUAGES NONE) +if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) + message(FATAL_ERROR "CWD used as binary dir") +endif() +]=]) + + file(REMOVE_RECURSE "${source_dir}/build") + # Test with a setup where binary_dir won't be created by `run_cmake_with_options` + run_cmake_with_options(S-arg-build-dir-not-created -S ${source_dir} build/) + run_cmake_with_options(S-arg-reverse-build-dir-not-created build/ -S${source_dir} ) + set(source_dir ${RunCMake_SOURCE_DIR}/ExplicitDirs) set(binary_dir ${RunCMake_BINARY_DIR}/ExplicitDirs-build) |