mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-04 04:40:56 -06:00
In order to keep infinitely-recursive scripts from causing a stack overflow in the CMake executable, CMake now imposes a maximum recursion limit before issuing an error message. The limit can be adjusted at runtime with CMAKE_MAXIMUM_RECURSION_DEPTH. Fixes: #18694
15 lines
420 B
CMake
15 lines
420 B
CMake
cmake_minimum_required(VERSION 3.12)
|
|
set(CTEST_RUN_CURRENT_SCRIPT 0)
|
|
|
|
message("@LEVEL_CURRENT@")
|
|
|
|
set(CTEST_SOURCE_DIRECTORY "@CTEST_SOURCE_DIRECTORY@")
|
|
set(CTEST_BINARY_DIRECTORY "@CTEST_BINARY_DIRECTORY@")
|
|
set(CTEST_COMMAND "@CTEST_COMMAND@")
|
|
|
|
ctest_run_script("${CMAKE_CURRENT_LIST_DIR}/ctest_run_script_@LEVEL_NEXT@.cmake" RETURN_VALUE val)
|
|
|
|
if(NOT val EQUAL 0)
|
|
message(FATAL_ERROR "Nested script failed")
|
|
endif()
|