Commit 7a3ed464 authored by Bill Hoffman's avatar Bill Hoffman

ENH: add test for working directory of custom command and target

parent 347c5f4b
PROJECT(TestWorkingDir)
ADD_CUSTOM_COMMAND(
OUTPUT "${TestWorkingDir_BINARY_DIR}/working.c"
COMMAND "${CMAKE_COMMAND}" -E copy ./working.c "${TestWorkingDir_BINARY_DIR}/working.c"
WORKING_DIRECTORY "${TestWorkingDir_SOURCE_DIR}"
COMMENT "custom command"
)
SET_SOURCE_FILES_PROPERTIES(
"${TestWorkingDir_BINARY_DIR}/working.c"
"${TestWorkingDir_BINARY_DIR}/customTarget.c"
PROPERTIES GENERATED 1)
ADD_EXECUTABLE(working "${TestWorkingDir_BINARY_DIR}/working.c"
"${TestWorkingDir_BINARY_DIR}/customTarget.c")
ADD_CUSTOM_TARGET(
Custom ALL
COMMAND "${CMAKE_COMMAND}" -E copy_if_different ./customTarget.c "${TestWorkingDir_BINARY_DIR}/customTarget.c"
WORKING_DIRECTORY "${TestWorkingDir_SOURCE_DIR}"
)
ADD_DEPENDENCIES(working Custom)
int customTarget();
int main()
{
return customTarget();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment