mirror of
https://github.com/reactos/CMake.git
synced 2024-12-02 08:37:09 +00:00
9a20abf04a
Some tests only need to run CMake to configure and generate a build tree, but not actually perform the build. Add a new "Tests/CMakeOnly" directory dedicated for this purpose. Add a helper script to drive each test by creating a fresh build tree and running CMake on it. Add macro "add_CMakeOnly_test" to help create tests using the script.
13 lines
417 B
CMake
13 lines
417 B
CMake
set(source_dir "@CMAKE_CURRENT_SOURCE_DIR@/${TEST}")
|
|
set(binary_dir "@CMAKE_CURRENT_BINARY_DIR@/${TEST}-build")
|
|
file(REMOVE_RECURSE "${binary_dir}")
|
|
file(MAKE_DIRECTORY "${binary_dir}")
|
|
execute_process(
|
|
COMMAND ${CMAKE_COMMAND} "${source_dir}" -G "@CMAKE_TEST_GENERATOR@"
|
|
WORKING_DIRECTORY "${binary_dir}"
|
|
RESULT_VARIABLE result
|
|
)
|
|
if(result)
|
|
message(FATAL_ERROR "CMake failed to configure ${TEST}")
|
|
endif()
|