2013-05-15 23:19:20 +04:00
|
|
|
include(RunCMake)
|
|
|
|
|
2013-07-09 23:26:15 +04:00
|
|
|
run_cmake(CopyFileErrorNoCopyFile)
|
2013-05-15 23:19:20 +04:00
|
|
|
run_cmake(NoArgs)
|
|
|
|
run_cmake(OneArg)
|
|
|
|
run_cmake(TwoArgs)
|
|
|
|
run_cmake(NoCopyFile)
|
2013-05-15 23:30:34 +04:00
|
|
|
run_cmake(NoCopyFile2)
|
2013-07-09 23:26:15 +04:00
|
|
|
run_cmake(NoCopyFileError)
|
2013-05-15 23:19:20 +04:00
|
|
|
run_cmake(NoOutputVariable)
|
2013-05-15 23:30:34 +04:00
|
|
|
run_cmake(NoOutputVariable2)
|
2013-06-06 21:54:44 +04:00
|
|
|
run_cmake(NoSources)
|
2013-05-15 23:19:20 +04:00
|
|
|
run_cmake(BadLinkLibraries)
|
2013-06-06 21:54:44 +04:00
|
|
|
run_cmake(BadSources1)
|
|
|
|
run_cmake(BadSources2)
|
2013-05-15 23:19:20 +04:00
|
|
|
run_cmake(NonSourceCopyFile)
|
|
|
|
run_cmake(NonSourceCompileDefinitions)
|
2014-12-03 19:02:31 +03:00
|
|
|
|
2016-05-24 22:33:34 +03:00
|
|
|
set(RunCMake_TEST_OPTIONS --debug-trycompile)
|
|
|
|
run_cmake(PlatformVariables)
|
|
|
|
unset(RunCMake_TEST_OPTIONS)
|
|
|
|
|
2016-02-19 21:23:48 +03:00
|
|
|
run_cmake(TargetTypeExe)
|
|
|
|
run_cmake(TargetTypeInvalid)
|
|
|
|
run_cmake(TargetTypeStatic)
|
|
|
|
|
2014-12-03 19:02:31 +03:00
|
|
|
run_cmake(CMP0056)
|
2015-01-23 17:45:00 +03:00
|
|
|
|
|
|
|
if(RunCMake_GENERATOR MATCHES "Make|Ninja")
|
|
|
|
# Use a single build tree for a few tests without cleaning.
|
|
|
|
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/RerunCMake-build)
|
|
|
|
set(RunCMake_TEST_NO_CLEAN 1)
|
|
|
|
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
|
|
|
|
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
|
|
|
|
set(in_tc "${RunCMake_TEST_BINARY_DIR}/TryCompileInput.c")
|
|
|
|
file(WRITE "${in_tc}" "int main(void) { return 0; }\n")
|
|
|
|
|
|
|
|
# Older Ninja keeps all rerun output on stdout
|
|
|
|
set(ninja "")
|
|
|
|
if(RunCMake_GENERATOR STREQUAL "Ninja")
|
|
|
|
execute_process(COMMAND ${RunCMake_MAKE_PROGRAM} --version
|
|
|
|
OUTPUT_VARIABLE ninja_version OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
if(ninja_version VERSION_LESS 1.5)
|
|
|
|
set(ninja -ninja-no-console)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
message(STATUS "RerunCMake: first configuration...")
|
|
|
|
run_cmake(RerunCMake)
|
|
|
|
run_cmake_command(RerunCMake-nowork${ninja} ${CMAKE_COMMAND} --build .)
|
|
|
|
|
|
|
|
execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) # handle 1s resolution
|
|
|
|
message(STATUS "RerunCMake: modify try_compile input...")
|
|
|
|
file(WRITE "${in_tc}" "does-not-compile\n")
|
|
|
|
run_cmake_command(RerunCMake-rerun${ninja} ${CMAKE_COMMAND} --build .)
|
|
|
|
run_cmake_command(RerunCMake-nowork${ninja} ${CMAKE_COMMAND} --build .)
|
|
|
|
|
|
|
|
unset(RunCMake_TEST_BINARY_DIR)
|
|
|
|
unset(RunCMake_TEST_NO_CLEAN)
|
|
|
|
endif()
|