CMake/Tests/CMakeOnly/Test.cmake.in
Bill Hoffman 9090572f5c Add ability to include a file in a project via a cache variable.
If a variable exists called CMAKE_PROJECT_<projectName>_INCLUDE,
the file pointed to by that variable will be included as the last step
of the project command.
2012-02-17 12:41:39 -05:00

14 lines
434 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} ${CMAKE_ARGS}
"${source_dir}" -G "@CMAKE_TEST_GENERATOR@"
WORKING_DIRECTORY "${binary_dir}"
RESULT_VARIABLE result
)
if(result)
message(FATAL_ERROR "CMake failed to configure ${TEST}")
endif()