1 cmake_minimum_required (VERSION 2.6)
2 PROJECT(TestWorkingDir)
5 OUTPUT "${TestWorkingDir_BINARY_DIR}/working.c"
6 COMMAND "${CMAKE_COMMAND}" -E copy ./working.c.in "${TestWorkingDir_BINARY_DIR}/working.c"
7 WORKING_DIRECTORY "${TestWorkingDir_SOURCE_DIR}"
8 COMMENT "custom command"
11 SET_SOURCE_FILES_PROPERTIES(
12 "${TestWorkingDir_BINARY_DIR}/working.c"
13 "${TestWorkingDir_BINARY_DIR}/customTarget.c"
14 PROPERTIES GENERATED 1)
16 ADD_EXECUTABLE(working "${TestWorkingDir_BINARY_DIR}/working.c"
17 "${TestWorkingDir_BINARY_DIR}/customTarget.c")
21 COMMAND "${CMAKE_COMMAND}" -E copy_if_different ./customTarget.c "${TestWorkingDir_BINARY_DIR}/customTarget.c"
22 WORKING_DIRECTORY "${TestWorkingDir_SOURCE_DIR}"
25 ADD_DEPENDENCIES(working Custom)