https://github.com/Kitware/CMake
Tip revision: 0aae790a5edc2f8cc7501f61c011409c55d32d89 authored by Brad King on 23 June 2021, 13:01:47 UTC
CMake 3.21.0-rc1
CMake 3.21.0-rc1
Tip revision: 0aae790
EnforceConfig.cmake.in
# Choose a configuration with which to drive CTest tests.
if(CTEST_CONFIGURATION_TYPE)
set(CTestTest_CONFIG "${CTEST_CONFIGURATION_TYPE}")
else()
set(CTestTest_CONFIG "@CTestTest_CONFIG@")
endif()
# Choose a configuration that was built if none is given.
if(NOT CTEST_CONFIGURATION_TYPE)
set(CTEST_CMD "@CMAKE_CTEST_COMMAND@@CMAKE_EXECUTABLE_SUFFIX@")
get_filename_component(CTEST_DIR "${CTEST_CMD}" PATH)
get_filename_component(CTEST_EXE "${CTEST_CMD}" NAME)
foreach(cfg Release Debug MinSizeRel RelWithDebInfo)
if(NOT CTEST_CONFIGURATION_TYPE)
if(EXISTS "${CTEST_DIR}/${cfg}/${CTEST_EXE}")
set(CTEST_CONFIGURATION_TYPE ${cfg})
endif()
endif()
endforeach()
if(NOT CTEST_CONFIGURATION_TYPE)
if("@CMAKE_C_COMPILER_ID@;@CMAKE_C_SIMULATE_ID@;@CMAKE_C_COMPILER_FRONTEND_VARIANT@" STREQUAL "Clang;MSVC;GNU")
# A valid configuration is required for this compiler in tests that do not set CMP0091 to NEW.
set(CTEST_CONFIGURATION_TYPE Debug)
else()
set(CTEST_CONFIGURATION_TYPE NoConfig)
endif()
endif()
message("Guessing configuration ${CTEST_CONFIGURATION_TYPE}")
endif()
# Isolate tests from user configuration in the environment.
unset(ENV{CMAKE_GENERATOR})
unset(ENV{CMAKE_GENERATOR_INSTANCE})
unset(ENV{CMAKE_GENERATOR_PLATFORM})
unset(ENV{CMAKE_GENERATOR_TOOLSET})
unset(ENV{CMAKE_EXPORT_COMPILE_COMMANDS})
@TEST_HOME_ENV_CODE@