1 # Give Git access to the real home directory to get user's settings.
2 if(DEFINED ENV{CTEST_REAL_HOME})
3 set(ENV{HOME} "$ENV{CTEST_REAL_HOME}")
7 COMMAND "${GIT_EXECUTABLE}" status
8 WORKING_DIRECTORY "${CMake_SOURCE_DIR}"
11 RESULT_VARIABLE result
13 string(REPLACE "\n" "\n " output " ${output}")
14 if(NOT result EQUAL 0)
15 message(FATAL_ERROR "'git status' failed (${result}):\n${output}")
18 if(output MATCHES "\n[ \t#]*(Changes |new file:|modified:|Untracked )")
19 message(FATAL_ERROR "The source tree is not clean. 'git status' reports:\n${output}")
22 message(STATUS "The source tree is clean.")