2013-01-02 20:10:04 +04:00
|
|
|
include(RunCMake)
|
|
|
|
|
|
|
|
run_cmake(CommandConflict)
|
|
|
|
if("${RunCMake_GENERATOR}" MATCHES "Visual Studio" OR "${RunCMake_GENERATOR}" MATCHES "XCode" )
|
|
|
|
run_cmake(OutputConflict)
|
|
|
|
endif()
|
|
|
|
run_cmake(EmptyCondition1)
|
|
|
|
run_cmake(EmptyCondition2)
|
|
|
|
run_cmake(BadCondition)
|
|
|
|
run_cmake(DebugEvaluate)
|
2014-04-25 22:11:05 +04:00
|
|
|
|
|
|
|
set(timeformat "%Y%j%H%M%S")
|
|
|
|
|
|
|
|
file(REMOVE "${RunCMake_BINARY_DIR}/WriteIfDifferent-build/output_file.txt")
|
|
|
|
set(RunCMake_TEST_FILE "WriteIfDifferent")
|
|
|
|
set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/WriteIfDifferent-build")
|
|
|
|
run_cmake(WriteIfDifferent-prepare)
|
|
|
|
unset(RunCMake_TEST_FILE)
|
|
|
|
unset(RunCMake_TEST_BINARY_DIR)
|
|
|
|
file(TIMESTAMP "${RunCMake_BINARY_DIR}/WriteIfDifferent-build/output_file.txt" timestamp ${timeformat})
|
|
|
|
if(NOT timestamp)
|
|
|
|
message(SEND_ERROR "Could not get timestamp for \"${RunCMake_BINARY_DIR}/WriteIfDifferent-build/output_file.txt\"")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1)
|
|
|
|
|
|
|
|
set(RunCMake_TEST_NO_CLEAN ON)
|
|
|
|
run_cmake(WriteIfDifferent)
|
|
|
|
file(TIMESTAMP "${RunCMake_BINARY_DIR}/WriteIfDifferent-build/output_file.txt" timestamp_after ${timeformat})
|
|
|
|
if(NOT timestamp_after)
|
|
|
|
message(SEND_ERROR "Could not get timestamp for \"${RunCMake_BINARY_DIR}/WriteIfDifferent-build/output_file.txt\"")
|
|
|
|
endif()
|
|
|
|
unset(RunCMake_TEST_NO_CLEAN)
|
|
|
|
|
|
|
|
if (NOT timestamp_after STREQUAL timestamp)
|
|
|
|
message(SEND_ERROR "WriteIfDifferent changed output file.")
|
|
|
|
endif()
|