CMake/Tests/RunCMake/Configure/RemoveCache.cmake
Brad King 25b6e7b710 Tolerate removed/replaced CMakeCache.txt with old CMakeFiles/
Users or scripts commonly remove or replace `CMakeCache.txt` without
also removing `CMakeFiles/`.  In this case the information saved in the
cache from platform information initialization is missing, so we need to
re-initialize it.  In such a case, remove the platform information
directory so that re-initialization will occur and restore needed
information to the cache.

Closes: #14820
2016-11-17 10:29:58 -05:00

18 lines
255 B
CMake

enable_language(C)
set(vars
CMAKE_EXECUTABLE_FORMAT
)
if(CMAKE_HOST_UNIX)
list(APPEND vars
CMAKE_UNAME
)
endif()
foreach(v IN LISTS vars)
if(NOT DEFINED ${v})
message(SEND_ERROR "Variable '${v}' is not set!")
endif()
endforeach()