mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 21:59:54 -06:00
Add tests that showcase cmake -S limitations
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user